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: ??? Number of days betwwen two dates?

Re: ??? Number of days betwwen two dates?

From: Duncan Berriman <Duncan_at_dcl.co.uk>
Date: 1997/08/11
Message-ID: <01bca66a$357167a0$ce3e13ac@3io731.CHARNWOOD.GB.ASTRA.COM>#1/1

Suggest you convert to Julian to_char(date,'J') and then subtract one from the other.
Regards
Duncan Berriman

Huang, Joseph <huang_at_baptized.com.---> wrote in article <5rnq02$d28_at_bolivia.earthlink.net>...
 I need a function, which I can use in other stored procedures, to return number of days of two given dates. The only similar function I can found in Oracle manual is MONTHS_BETWEEN(). However, the problem is MONTHs_BETWEEN() return number based on 31-day month which is incorrect normally. For example, instead of 29 days, the function returns 1.0322581 (32 days) from 02/01/97 to 03/02/97.

Before writing our own function to get correct number of days, I'd like to know whether this kind of function exists somewhere so I don't need to redo it. Any suggestions?

Thanks in advance.

Joseph Huang

-- 
My email address is intentionally invalid to foil spammers.  Delete the
".---" to get my real address.


----------
Received on Mon Aug 11 1997 - 00:00:00 CDT

Original text of this message

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