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

Home -> Community -> Usenet -> c.d.o.server -> ??? Number of days betwwen two dates?

??? Number of days betwwen two dates?

From: Huang, Joseph <huang_at_baptized.com.--->
Date: 1997/07/30
Message-ID: <5rnq02$d28@bolivia.earthlink.net>#1/1

This is a multi-part message in MIME format.

------=_NextPart_000_0001_4C1C9640.4C1C9640 Content-Type: text/plain;

        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

 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

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

------=_NextPart_000_0001_4C1C9640.4C1C9640 Content-Type: text/html;

        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
<HTML>
<HEAD>

<META content=3Dtext/html;charset=3Diso-8859-1 =
http-equiv=3DContent-Type>
<META content=3D'"MSHTML 4.71.1003.0"' name=3DGENERATOR>
</HEAD>
<BODY bgColor=3D#ffffff>
<P><FONT color=3D#000080 face=3D"Lucida Console" size=3D2>&nbsp;I need a =
function,=20
which I can use in other stored procedures, to return number of days of = two=20
given dates. The only similar function I can found in Oracle manual is=20 MONTHS_BETWEEN(). However, the problem is MONTHs_BETWEEN() return number = based=20
on 31-day month which is incorrect normally. For example, instead of 29 = days,=20
the function returns 1.0322581 (32 days) from 02/01/97 to = 03/02/97.</FONT>
</P>
<P><FONT color=3D#000080 face=3D"Lucida Console" size=3D2><FONT>Before =
writing our own=20
function to get correct number of days, I'd like to know whether this = kind of=20
function exists somewhere so I don't need to redo it. Any=20 suggestions?</FONT></FONT>&nbsp;
<P><FONT color=3D#000080 face=3D"Lucida Console" size=3D2><FONT>Thanks =
in=20
advance.</FONT></FONT>&nbsp;
<P><FONT color=3D#000080 face=3D"Lucida Console" size=3D2><FONT>Joseph=20
Huang</FONT></FONT>&nbsp;
<P><FONT color=3D#000080 face=3D"Lucida Console" size=3D2><BR>-- <BR>My =
email address=20
is intentionally invalid to foil spammers.&nbsp; Delete the = &quot;.---&quot; to=20
get my real address.</FONT>
</P>
</BODY></HTML>

------=_NextPart_000_0001_4C1C9640.4C1C9640-- Received on Wed Jul 30 1997 - 00:00:00 CDT

Original text of this message

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