Guten Morgen.
Prüfe dein Statement mal ohne Parameter:
Delphi-Quellcode:
begin
SQL.Text
:= '
SELECT COUNT(*) FROM buchung '
+ '
WHERE (buchung.anreise BETWEEN #01/01/2006# AND #12/31/2006#) '
+ '
OR (buchung.abreise BETWEEN #01/01/2006# AND #12/31/2006#) '
+ '
ORDER BY buchung.anreise '
;
// ...
end;
Wenn das Ergebnis für Count() größer als 0 ist, dann versuche mal folgendes:
Delphi-Quellcode:
begin
SQL.Text
:= '
SELECT COUNT(*) FROM buchung '
+ '
WHERE (buchung.anreise BETWEEN :datevon1 AND :datebis1) '
+ '
OR (buchung.abreise BETWEEN :datevon2 AND :datebis2) '
+ '
ORDER BY buchung.anreise '
;
with Parameters
do
begin
ParamValues['
datevon1'] := PlannerDatePicker21.Date;
ParamValues['
datebis1'] := PlannerDatePicker22.Date;
ParamValues['
datevon2'] := PlannerDatePicker21.Date;
ParamValues['
datebis2'] := PlannerDatePicker22.Date;
end;
// ...
end;
Grüße vom marabu