Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Need Script That Calc Hours Between 2 Dates
In article <371396F7.345CD36E_at_aud.alcatel.com>, Dan Navarro <daniel_nava
rro_at_aud.alcatel.com> writes
>Does anyone have a script that calculates the difference between
>2 dates in hours?
>
>Thanks in advance to anyone who can help ...
>
How about simple date arithmetic?
e.g.
SQL> select (to_date('13/04/99 10:30', 'DD/MM/YY HH24:MI') -
to_date('12/04/99 08:15', 'DD/MM/YY HH24:MI')) * 24 AS hours from dual
HOURS --------- 26.25
--
Andy Hardy. PGP key available on request