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

Home -> Community -> Usenet -> c.d.o.server -> Re: Difference between DATE fields.

Re: Difference between DATE fields.

From: Tomm Carr <tommcatt_at_computer.org>
Date: 1997/09/04
Message-ID: <340F2806.4A5@computer.org>#1/1

Gilberto Casiraghi wrote:
>
> I would like to calculate the difference between DATE fields.
> In my case I have a table with 2 DATE datatype columns: the first
> is the start time, the second the end time.
> Using the select statment in sql*plus I would like to generate
> a report with the first 2 columns and a third column with the
> difference between the first 2. This difference MUST be in the
> format DD-MM-YYYY HH24:MI:SS.

The difference CANNOT be in the format DD-MM-YYYY HH24:MI:SS. Think about it. The difference between two dates is not another date, but the number of days between them. This can be displayed as years, months, days, hours, minutes, seconds if you want to do the conversion, but not as a date.

-- 
Tomm Carr
tommcatt@computer.org -- http://www.geocities.com/athens/delphi/6769
-- The Macintosh computer is like the open range;
-- In a world without fences, there are no Gates.
Received on Thu Sep 04 1997 - 00:00:00 CDT

Original text of this message

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