Subject Re: [firebird-support] substract two TIME values
Author Mitchell Peek
d_dude_2003 wrote:

>Hi there folks,
>
>How do i convert the TIME2 - TIME1 (TIME2 > TIME1)
>to number of hours?
>
>

time1 is a point in time as is time2. The difference, therefore, is
simply a floating point numeric represented in days. Multiplying this
difference by 24 hours /day converts to hours, right?

if time1 was yesterday at noon, and time2 is tonight at midnight, the
difference is 1.5 days * 24 hours/day =36 hours.

try this...

select (( cast('10/11/2006 18:00:00'as timestamp) - current_timestamp )
* 24) from rdb$database