Selecting with datetime

Forum related to MySQL

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
dpap
Fresh Boarder
Fresh Boarder
Posts: 1
Joined: 28.06.2014, 21:47

Selecting with datetime

Post 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 ?
Post Reply