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: format difference of dates as date

Re: format difference of dates as date

From: Rauf Sarwar <rs_arwar_at_hotmail.com>
Date: 5 Apr 2005 05:24:10 -0700
Message-ID: <1112703850.771731.242870@f14g2000cwb.googlegroups.com>

Tobias Wagner wrote:
> Frank van Bortel wrote:
> > Huh? Like the difference between April 1 and March 12 is January
31?
> > I miss your question, or it is nonsense. It does not make sense
> > to me anyway.
>
> Sorry, if I did not express myself clearly.
> Example:
> starttime = '2005-04-01 1:30:05'
> endtime = '2005-04-03 12:45:15'
> wanted result = '2 11:15:10'
>
> --
> Tobias Wagner

You would have to do this in a PLSQL function that takes end_date and start_date and returns varchar2 as 'DD HH24:MI:SS'.

Hint: (end_date - start_date) * 86400 will give you date difference in seconds. 86400 are number of seconds in a 24 hour period. Now you can do the math.

Regards
/Rauf Received on Tue Apr 05 2005 - 07:24:10 CDT

Original text of this message

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