Page 1 of 1

Selecting with datetime

Posted: 28.06.2014, 22:03
by dpap
I wrote this code

with form20.aZQuery do begin
emptydataset;
SQL.text := 'SELECT COUNT(aDateTimeFieldName) FROM aTable WHERE aDateTimeFieldName='+quotedStr(aDateTimeValueThatDoesntExistInAnyRecord);
open;
result := not isEmpty;
end;

I expect to return an empty table (recordcount =0, isEmpty = TRUE) but allways It returns isEmpty = FALSE (recordcount =1) even the datetime doesn' exist

Why ?
I'm somewhere wrong ?