Board index » off-topic » SQL query on Date Field

SQL query on Date Field


2003-11-15 02:49:49 AM
off-topic19
Hi All
I have Paradox table (Tmp.db) which includes a received date (DATEIN) and a
shipped date (DATEOUT). Some of the DATEOUT fields are empty as the unit
hasn't been shipped. How do I retrieve these records?
I am using Delphi3 standard and the database is on the same PC. The
following is a piece of the code.
DataModule1.Query1.Close;
DataModule1.Table2.Close;
DataModule1.Query1.SQL.Clear;
DataModule1.Query1.SQL.Add('select * from Tmp.db');
DataModule1.Query1.SQL.Add('where (DATEOUT>:TDate)');
DataModule1.Query1.SQL.Add('or (DATEOUT < :FDate)');
DataModule1.Query1.ParamByName('TDate').AsDate :=
StrToDate('12/31/2003');
**The following statement doesnt work. What I need is a method to retreive
records with empty DATEOUT fields............
DataModule1.Query1.ParamByName('FDate').AsDate :=
StrToDate('00/00/00');
DataModule1.Query1.ExecSQL;
Thank you,
George
 
 

Re:SQL query on Date Field

"George" < XXXX@XXXXX.COM >wrote in
Quote
DataModule1.Query1.ExecSQL;
try something like
SELECT * FROM Tmp.db
WHERE DATEOUT IS NULL
--
Iman
 

Re:SQL query on Date Field

Thanks Iman, it worked great....
George
"Iman L Crawford" <ilcrawford.at.hotmail.dot.com>wrote in message
Quote
"George" < XXXX@XXXXX.COM >wrote in
news: XXXX@XXXXX.COM :
>DataModule1.Query1.ExecSQL;

try something like

SELECT * FROM Tmp.db
WHERE DATEOUT IS NULL

--
Iman


 

{smallsort}