Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: date/time problem

Re: date/time problem

From: <oracle_user_at_my-dejanews.com>
Date: Fri, 23 Oct 1998 23:37:24 GMT
Message-ID: <70r3vk$d7e$1@nnrp1.dejanews.com>


This should help you,

select round(a*24)||':'||round(mod(a*86400,3600)/60)||':'|| mod(mod(a*86400,3600),60) from
(select (TO_DATE('10-23-1998 14:10:10', 'MM-DD-YYYY HH24:MI:SS') - TO_DATE('10-23-1998 11:00:00', 'MM-DD-YYYY HH:MI:SS')) a from dual);

srikant

In article <36304F6A.3AC8B4FF_at_holland.sun.com>,   andy sykes <andrew.sykes_at_holland.sun.com> wrote:
> 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
>

-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Fri Oct 23 1998 - 18:37:24 CDT

Original text of this message

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