Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: format difference of dates as date
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
![]() |
![]() |