Page 1 of 1

SQL Get the Date only from DateTimestamp Field?

Posted: 25.11.2007, 13:59
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

Posted: 27.11.2007, 12:20
by Gerard
What database are you using? (MSSQL, Postgres, etc.)

Posted: 27.11.2007, 12:24
by DaveB
Using Firebird

Posted: 27.11.2007, 16:19
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