Subject Re: [firebird-support] Re: time data type and elapsed
Author Lucas Franzen
Steve,

> Thanks. Of course -- why didn't I think of that?

(see thread " Stored procedure question" from Aug 28th)

;-)

> So, for example, I can get the elapsed hours with something like
> this sample SQL:
> select
> timeofpickup, timeofdropoff,
> ( (timeofdropoff - timeofpickup) + 86400) / 3600
> from reserve
> where timeofdropoff < timeofpickup

I haven't used the case function yet, but you can do sth. like:

select
timeofpickup, timeofdropoff,
case when timeofdropoff - timeofpickup < 0
then timeofdropoff - timeofpickup + 86400
else timeofdropoff - timeofpickup
from CRYSTAL_BOWL_LIMOUSINES

(if you use FB 1.5)

>
> It's funny how simple the answer is once you know the answer!

:-)

Luc.