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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Minutes Between Function?

Re: Minutes Between Function?

From: Brian Tkatch <SPAMBLOCK.Maxwell_Smart_at_ThePentagon.com.SPAMBLOCK>
Date: Wed, 31 Oct 2001 16:33:50 GMT
Message-ID: <3be02654.1734761171@news.alt.net>


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

Original text of this message

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