Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> date/time problem
Hi All,
I want to compare two dates and display the difference in Hours,Mins &
seconds. Has anyone had to do this or can anyone suggest a solution ?
I have tried the months_between function but it doesn't appear to work
when the dates are the same e.g
SELECT MONTHS_BETWEEN(TO_DATE('10-23-1998 09:30:00', 'MM-DD-YYYY HH:MI:SS'),TO_DATE('10-23-1998 11:35:00', 'MM-DD-YYYY HH:MI:SS')) "Months" FROM DUAL
returns ;
Months
0
Assuming that this was to give me a decimal value corresponding to the
time,(the help says that is should), how would I convert that into
meaningfull Hrs,Min & Secs values ?
I would really appreciate some suggestions.
Regards
Andy
Received on Fri Oct 23 1998 - 04:42:02 CDT
![]() |
![]() |