Subject RE: [firebird-support] Extracting Time
Author Helen Borrie
At 12:55 PM 26/06/2003 +1000, you wrote:

>The cast statement returns milleseconds... pity - I'll have to do some
>client side work on it.

Another thing you can use is the EXTRACT() function:

SELECT CAST (
EXTRACT (HOUR FROM aTimestamp)
+ EXTRACT (MINUTE FROM aTimestamp)
+ EXTRACT (SECOND FROM aTimestamp)
AS TIME) as TimeOfDay
....

You will still get fractions of a second (not milliseconds: that's
Delphi; the Firebird fraction is ten-thousandths of a second) but they
will be .0000.

>It's a shame that the new dialect lost the simplicity of date and time being
>exactly that when it added the new data types.

Hmm, that's not a true assumption. The old DATE type was like the new
TIMESTAMP and there was no TIME type at all.

***Shame????*** Whoa! The new types not only make it much easier to get the
date (day) and time separately but they also make the date/time handling
conformant with the SQL standard.

heLen



>Alan
>
>
>
>
>To unsubscribe from this group, send an email to:
>firebird-support-unsubscribe@yahoogroups.com
>
>
>
>Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/