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: hour difference between two dates calculation???

Re: hour difference between two dates calculation???

From: Christopher Beck <clbeck_at_us.oracle.com>
Date: Wed, 11 Nov 1998 21:13:05 -0500
Message-ID: <72dh1b$g44$1@inet16.us.oracle.com>

selkadiki_at_my-dejanews.com wrote in message <72d5qi$hnr$1_at_nnrp1.dejanews.com>...
>How can I calculate the difference in hours between two Oracle date
datatypes?
>I know in Sybase you can use the datediff function, is there something
>equivalent or does someone have a procedure to do this.

Sure. If you subtract the two dates, you will get a number which will represent the
number of days between them. If you multiple that value by 24 you will get the result
in hours.

eg

SQL> select ( (sysdate+1/24) - sysdate ) * 24 from dual;

((SYSDATE+1/24)-SYSDATE)*24


                          1


Hope this helps.

chris.

--

Christopher Beck
clbeck_at_us.oracle.com

>
>Good day!
>
>Sal Elkadiki
>
>-----------== Posted via Deja News, The Discussion Network ==----------
>http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
Received on Wed Nov 11 1998 - 20:13:05 CST

Original text of this message

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