Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why does DateToStr = '' not work?

Status
Not open for further replies.

delphiman

Programmer
Dec 13, 2001
422
ZA

Can someone please tell me why the following procedure
between the begin and end statements does not work even
if there is nothing in tblFTableMyDate?


If I place a BreakPoint on the "if" statement I can
see that the value is in fact reflected as being '0'. But
even if I make the "if" statement to look for '0'
it won't work.


if DateToStr(tblFTableMyDate.value) = '' then
begin
DMCntcts.Query1.SQL.Clear;
DMCntcts.Query1.SQL.Add ('SELECT *');
DMCntcts.Query1.SQL.Add ('FROM "c:\h\Contacts\Cntcts.db" t2, "c:\h\Contacts\FTable.db" t1');
DMCntcts.Query1.SQL.Add ('WHERE t2.FollowUp = t1.FollowUp1');
DMCntcts.Query1.Active := True;
end
 
You may like to try...

Code:
if (tblFTableMyDate.IsNull) then ...

[thumbsup2]
Tim
 
..or

if (tblFTableMyDate.IsNull) OR (tblFTableMyDate.asDateTime = 0) then lou
(I am trying - a lot of people have told me that)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top