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: Date Calculation

Re: Date Calculation

From: James Lorenzen <james_lorenzen_at_allianzlife.com>
Date: Tue, 27 Apr 1999 13:19:09 GMT
Message-ID: <7g4dg9$m4o$1@nnrp1.dejanews.com>


This will work, it is a little funny looking, but it works.

Select to_char(((to_date('1990','yyyy') - 1) -- This sets a "0" date   + (date_fixed - date_occurred)), -- The "math"   'dd "Days" hh24 "Hours" mi "Minutes" ss "Seconds"') -- The format

 from dual                                            -- the test

Prints:
  "03 Days 08 Hours 15 Minutes 40 Seconds"

HTH
    James

In article <7g1nrh$11r$1_at_bgtnsc03.worldnet.att.net>,   "Oracle NetNews" <joey.ogalesco_at_bigfoot.com> wrote:
> John,
>
> Try this ..
>
> Select to_char(date_fixed - date_occurred,"dd-mon-yy hh24:mi") "Repair
> Time"
>
> john bruin wrote in message <37239D2C.5444_at_tssc.co.nz>...
> >Hi all
> >
> >I would like to know if it is possible to have a column showing the time
> >difference between two time columns. It seems to work with a
> >non-hours,min date format but otherwise not. Can anyone help here?
> >
> >ie Occurred Fixed Repair Time
> > 4-feb-99 3:00 PM 10-feb-99 4:00 PM 6 DAYS 1 HOUR
> >
> >select
> >to_char(date_occurred,'dd-mon-yy HH:MI PM') Occurred
> >,to_char(date_fixed,'dd-mon-yy HH:MI PM') Fixed
> >,something like - date_fixed - date_occurred 'Repair Time'
> >
> >Regards
> >John
>
>

-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Tue Apr 27 1999 - 08:19:09 CDT

Original text of this message

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