| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Minutes Between Function?
On 31 Oct 2001 09:11:22 -0800, Chris.Sammarco_at_millersville.edu (Chris
Sammarco) wrote:
>I know there is a Months between Function in pl/sql but is there a
>Hours between or minutes between function anywhere?
No.
However, subtracting two dates returns a number where 1 is a day.
SELECT
TO_DATE('1/5/1864', 'MM/DD/RRRR') -
TO_DATE('1/4/1864/12', 'MM/DD/RRRR/HH24') Time
FROM Dual;
TIME
.5
So to find the amounts of hours, * by 24, or 1440 for minutes.
SELECT
TO_NUMBER(
TO_DATE('1/5/1864', 'MM/DD/RRRR') -
TO_DATE('1/4/1864/12', 'MM/DD/RRRR/HH24')
) * 24 Hours FROM Dual;
HOURS
----------
12
Brian Received on Wed Oct 31 2001 - 10:33:50 CST
![]() |
![]() |