Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Need Script That Calc Hours Between 2 Dates

Re: Need Script That Calc Hours Between 2 Dates

From: Andy Hardy <aph_at_ahardy.demon.co.uk>
Date: Tue, 13 Apr 1999 23:39:50 +0100
Message-ID: <YNnExGA2e8E3EwGF@ahardy.demon.co.uk>


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


Received on Tue Apr 13 1999 - 17:39:50 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US