SQL Get the Date only from DateTimestamp Field?

Forum related to version 6.5.1 (alpha) and 6.6.x (beta) of ZeosLib's DBOs

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
DaveB
Fresh Boarder
Fresh Boarder
Posts: 5
Joined: 24.11.2007, 14:51

SQL Get the Date only from DateTimestamp Field?

Post by DaveB »

I want to Query using TZQuery but the Date field is a DateTimeStamp

So my param is passed like MyQuery.ParamByName('aDate').AsDate

Because of the time part of the field I seem to need to always add one
to the date to get the correct range.

In other DB Engines I believe in the SQL I can do
WHERE DATE(MYDATE) = :aDate

Which strips just the Date and gives me a true result.

Is there SQL ability like this using ZEOS?

Thank you
Gerard
Fresh Boarder
Fresh Boarder
Posts: 12
Joined: 31.10.2005, 21:32

Post by Gerard »

What database are you using? (MSSQL, Postgres, etc.)
DaveB
Fresh Boarder
Fresh Boarder
Posts: 5
Joined: 24.11.2007, 14:51

Post by DaveB »

Using Firebird
Gerard
Fresh Boarder
Fresh Boarder
Posts: 12
Joined: 31.10.2005, 21:32

Post by Gerard »

I don't know firebird at all. The link below has an example of casting time/date types in firebird.

http://www.firebirdsql.org/index.php?op ... stenried_1
Post Reply