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: Converting between Ingres and Oracle: Calculations with dates.

Re: Converting between Ingres and Oracle: Calculations with dates.

From: Scott Kronheim <skronheim_at_synertechsystems.com>
Date: Thu, 20 Jan 2000 10:48:03 -0500
Message-ID: <38872E33.5B24306D@synertechsystems.com>


When you subtract two dates in Oracle, you get the difference in days. The result will have a decimal part, so if you want to get the number of seconds between two date/time stamps, you can code:

        sec_diff := (time_out - time_in) * 24 * 60 * 60 This works because there are 24 hours in a day, 60 minutes in an hour, and 60 seconds in a minute. You can do similar things to get differences in days, hours, or minutes.

Hope that helps!



Scott Kronheim

Technical wrote:
>
> Dear All.
>
> Tanks for those who replied to my last message regarding Ingres Oracle
> converting. I have another problem.
>
> Under Ingres when using dates you can perform normal calculations on dates
> as normal e.g.
>
> Time_diff = (Time_out - Time_In) (All of these are of type date).
>
> My question is simply this: How can this be done under Oracle.
>
> Tanks in advance.
>
> Lloyd Graney.

-- Received on Thu Jan 20 2000 - 09:48:03 CST

Original text of this message

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