Subject Re: Time difference between two date columns
Author lysander4444
--- In firebird-support@yahoogroups.com, Shariful Alam
<murad_mouri@...> wrote:

> I need time difference between two date columns in
> hour basis. How can I get this in sql statement?

a pure DATE-type does not contain an information about the hour.
You could probably CAST it to a DATETIME, but that would bring the
same result as just substracting one date from another and multiplying
the result with 24.

select
ID_Field,
(EndDateField-StartDateField) * 24 "csm_HoursPassed"
from
Tablename


keep in mind that this result will be somewhat inprecise, because
every date will be evaluated as of midnight.
So, for example, "May 2nd 2006, 23:59" will have a timespan of 24
hours to "May 3rd 2006, 00:01"

ciao,
André