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: phil chang <pxchang0_at_sunspot.wcc.com>
Date: 1997/07/31
Message-ID: <5rqo87$59i$1@news-2.csn.net>#1/1

You can subtract the dates to get the number of days between them.

For example, select to_date('02-mar-97') - to_date('01-feb-97') from dual returns 29.

Phil

In article <5rnq02$d28_at_bolivia.earthlink.net>, "Huang, Joseph" <huang_at_baptized.com.---> says:
#
# 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
#
Received on Thu Jul 31 1997 - 00:00:00 CDT

Original text of this message

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