Autor Beitrag
ski20
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 48



BeitragVerfasst: Fr 26.01.07 16:35 
Hi alle,
kann mir jemand hiermit helfen ? , ein SQL abfrage mit ODER ...bzw AND und OR, so muss es sein !!! es fehlt nur die klammer VOR "Type" und NACH "Vermietung". Aber wie ist der Syntax hier ??


ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
 SQL.Clear;
 SQL.Add(' SELECT *                       ');
 SQL.Add(' FROM tblDaten                ');
 SQL.Add(' WHERE Auswahl = TRUE          ');
 SQL.Add(' AND Activesatz = TRUE          ');
 SQL.Add(' AND  Type = ''Haus Vermietung'' OR Type =''Wohnung Vermietung''  ');
 SQL.Add('ORDER BY [Type]                  ');

Danke und nice weekend.
Ski

Moderiert von user profile iconjasocul: Delphi-Tags hinzugefügt
Grenzgaenger
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Fr 26.01.07 21:14 
sag mal, was ist eigentlich deine frage?
ski20 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 48



BeitragVerfasst: Fr 26.01.07 23:18 
Titel: spl AND und OR
Hi....
ich möchte das sowohl datensätze mit "Haus Vermietung" UND "Wohnung Vermietung" angezeigt werden,

ausblenden Delphi-Quelltext
1:
SQL.Add(' AND Type = ''Haus Vermietung'' OR Type =''Wohnung Vermietung'' ');					




hier wird nur EINS oder der andere.

DAnke Ski

Moderiert von user profile iconjasocul: Delphi-Tags hinzugfügt
jasocul
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 6395
Erhaltene Danke: 149

Windows 7 + Windows 10
Sydney Prof + CE
BeitragVerfasst: Fr 26.01.07 23:30 
Titel: Re: spl AND und OR
Einfach die Klammern richtig setzen.
ausblenden Delphi-Quelltext
1:
SQL.Add(' AND ((Type = ''Haus Vermietung'') OR (Type =''Wohnung Vermietung'')) ');					
ski20 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 48



BeitragVerfasst: So 28.01.07 15:32 
Titel: and und Or
Danke .....genau das wollte ich wissen :-))

Ski