Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: hour difference between two dates calculation???
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