Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Processing Time
The fraction is a fraction of a day. So months_between does not give just
the months, the fraction is the fraction of a day and from that you can
derive how many hours, minutes, seconds etc. Since it is no longer a date
when you subtract one from another , it is a number, then Oracle cannot
format the result into a time. You could write your own function that takes
a fraction of a day and returns the "time" formatted as X H Y M Z S or
X:Y:Z.
Jim
"Thomas Ruschival" <t.ruschival_at_vivid-md.de> wrote in message
news:9u844r$6u0ho$1_at_ID-37256.news.dfncis.de...
> Hi,
> I didnīt find information how to process time in SQL. Are ther any
> functions to get a number into a format readable for human beings. If I
> subtract one date from another I always get the Difference in days. How
do
> I get the difference in years, or hours?
> Example: SELECT TO_DATE('2000','YYYY') -TO_DATE('1999','YYYY') FROM
DUAL
> Result: 366
>
> Example: SELECT TO_DATE('21:00','HH24:MI') -TO_DATE('19:30','HH24:MI')
> FROM DUAL
> Result: ,020833333
>
> I donīt want to get 0,0625..... I want to see something like 1 H 30
Minutes!
>
> I know functions like months_between but are ther others to fomat dates
ams
> times?
>
> Thanks
> Thomas
>
>
Received on Fri Nov 30 2001 - 09:44:49 CST
![]() |
![]() |