Autor Beitrag
Felix2000
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 124



BeitragVerfasst: Sa 11.02.12 13:10 
Hi Folks !

Ich bekomme hier bei dem SQL Statement einen Fehler:
ausblenden SQL-Anweisung
1:
2:
3:
SELECT MAX(LEN(tabelle1.FeldA))
FROM tabelle1
WHERE tabelle1.FeldX = `ABC`;

Diese soll die Stringlänge einzelner Datensätze aus der Spalte FeldA ermitteln und dann davon die größten ausgeben. Ich erhalte hier allerdings die Meldung, dass ein Syntaxfehler vorliegt. Ich finde den Fehler nicht (ich nutze dem MS SQL Server 2008 R2).

Greetz
Felix

Moderiert von user profile iconTh69: SQL-Tags hinzugefügt
daeve
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 116
Erhaltene Danke: 3

Windows (XP Pro, 7 Ultimate x64)
C#,WPF,Java,ASP.Net, VS 2010 Ultimate (x86)
BeitragVerfasst: Sa 11.02.12 13:31 
sry
Th69
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Moderator
Beiträge: 4798
Erhaltene Danke: 1059

Win10
C#, C++ (VS 2017/19/22)
BeitragVerfasst: Sa 11.02.12 14:18 
Hallo Felix,

die Anführungsstriche sehen mir eigenartig aus. Hast du auch wirklich ' benutzt (auf der deutschen Tastatur SHIFT+#)?

Und wenn du dies im Code benutzt, dann verwende besser SQL: Parameter von Befehlen.
DennisXX
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 133



BeitragVerfasst: Sa 11.02.12 23:28 
Hallo nochmal !

Sorry ich meinte natürlich dieses Zeichen: '

Gruß
Dennis
Ralf Jansen
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 4708
Erhaltene Danke: 991


VS2010 Pro, VS2012 Pro, VS2013 Pro, VS2015 Pro, Delphi 7 Pro
BeitragVerfasst: So 12.02.12 01:11 
Schizophren? Biete behandle das und entscheide dich anschließend ob du Felix oder Dennis sein möchtest danke.