Re: Date arithmetic with oracle

From: Alvin W. Law <alaw_at_oracle.com>
Date: 1996/08/01
Message-ID: <ALAW.96Aug1160522_at_ap283sun.oracle.com>#1/1


In article <31FFEBAD.7DD0_at_ccm2.hf.intel.com> Erik Johnson <ErikX_Johnson_at_ccm2.hf.intel.com> writes:
>
> I need to calculate the number of hour between 2 dates. So if I had:
>
> date_a 7/31/96 10:10:10
> date_b 7/31/96 12:12:12
>
> date_b - date_a = 2 hrs.
>
> How can I do this in a SQL statement with Oracle?? Just subtracting the
> dates gives me nothing. And I've tried messing with the different date
> functions and formats with no luck.
>
> Thanks in advance for any help.

The difference is dates is given in unit of days. If you want the difference in hours/minutes/seconds, multiple by 24/1440/86400. Received on Thu Aug 01 1996 - 00:00:00 CEST

Original text of this message