Board index » delphi » Timestamp field in Paradox

Timestamp field in Paradox

Anyone know what the correct SQL statement would be to search a
Timestamp field for a blank value in Delphi 2.0?
Ex: "Select * from Table where Timefield = <something>'
I tried '= NULL' and "= ''" but these gave errors.
Please email if you know.
Thanks

--
Jeffrey D. Curry
http://www.pipeline.com/~jcurry

 

Re:Timestamp field in Paradox


You might try " = 0 " since timestamp is stored as a floating point
value.  I don't think Paradox tables have NULL valued fields in the true
(SQL) sense of the word.

Quote
Jeff Curry wrote:

> Anyone know what the correct SQL statement would be to search a
> Timestamp field for a blank value in Delphi 2.0?
> Ex: "Select * from Table where Timefield = <something>'
> I tried '= NULL' and "= ''" but these gave errors.
> Please email if you know.
> Thanks

> --
> Jeffrey D. Curry
> http://www.pipeline.com/~jcurry

--
Patrick K. Coffer
pcof...@flash.net
CIS: 74401,1267
214-622-0256

Re:Timestamp field in Paradox


Quote
Jeff Curry wrote:

> Anyone know what the correct SQL statement would be to search a
> Timestamp field for a blank value in Delphi 2.0?
> Ex: "Select * from Table where Timefield = <something>'
> I tried '= NULL' and "= ''" but these gave errors.
> Please email if you know.
> Thanks

> --
> Jeffrey D. Curry
> http://www.pipeline.com/~jcurry

Try "IS NULL".  A fragment of an SQL statement where "Event End"
is a time stamp follows:

      ...
      SQL.Add('  ((GADEVENT."Event End" IS NULL OR ');
      SQL.Add('    GADEVENT."Event End" > "' +
                   FormatDateTime('M/d/yyyy', SelectedDateFirst) +
                   '") AND ' +
      ...

However, in another part of the same program I used ' = "" '
for reasons I never understood:

    ...
    IF   UnitsSQLClause = ''
    THEN BEGIN
      {"IS NULL" doesn't work below -- must be Paradox bug}
      Query.SQL.Add(' (GADEVENT."Primary Cause Code" = "" OR ');
      Query.SQL.Add('  GADEVENT."Event End" = "")')
    END
    ...

--
Earl F. Glynn          EarlGl...@WorldNet.att.net
EFG Software              913/859-9557  Voice/Fax
   Scientific/Engineering/Medical Applications

Other Threads