Re: Minutes and Seconds
Date: Fri, 18 Oct 2002 14:32:14 -0500
Message-ID: <7J6cna4taskj_C2gXTWcow_at_comcast.com>
"Larry" <schiffer52_at_attbi.com> wrote in news:q_UJ8.29582$0A2.24842_at_rwcrnsc54:
> Hi All... any help is greatly appreciated...
>
> I'd like to return the number of minutes and seconds when subtracting
> one date from another (both dates will be the same date..just the
> hours, minutes and seconds will be different)
>
> I've tried using the round function, to_date, to_char in various
> comnbinations, with no luck..
>
> this is the closet I've come...any one have any suggestions?
>
> I thought I could use the round function with a format mask of 'mi'
> ..but it returns 'invalid column:
>
> Many thanks for the help.
>
> select round(to_date('31-MAY-2002 23:59:00','DD-MON-YYYY HH24:MI:SS')
> - TO_dATE
> ('31-MAY-2002 21:59:00','DD-MON-YYYY HH24:MI:SS'),'mi') FROM DUAL
>
>
You can set up a statement or sql script or procedure to set the date for your user session, thus:
ALTER SESSION SET NLS_DATE_FORMAT = 'Mon-DD-YYYY HH24:MI:SS';
Then try this:
SELECT SYSDATE, SYSDATE + .01 FROM DUAL;
to get this:
SYSDATE SYSDATE+.01
-------------------- --------------------Oct-14-2002 19:45:36 Oct-14-2002 20:00:00 Received on Fri Oct 18 2002 - 21:32:14 CEST