Subject | Re: [firebird-support] Re: time data type and elapsed |
---|---|
Author | Lucas Franzen |
Post date | 2003-08-29T00:43:43Z |
Steve,
;-)
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)
Luc.
> 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 likeI haven't used the case function yet, but you can do sth. like:
> this sample SQL:
> select
> timeofpickup, timeofdropoff,
> ( (timeofdropoff - timeofpickup) + 86400) / 3600
> from reserve
> where timeofdropoff < timeofpickup
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.