Xref: alice comp.databases.oracle.misc:26996
Path: alice!news-feed.fnsi.net!news.maxwell.syr.edu!newsfeed1.earthlink.net!lsanca1-snf1!news.gtei.net!news.netgate.net.nz!news.xtra.co.nz!not-for-mail
From: Randall Prentice <RJP0@paradise.net.nz>
Newsgroups: comp.databases.oracle.misc
Subject: Re: Anyone have a DAYS_BETWEEN function?
Date: Wed, 03 Mar 1999 18:32:51 +0800
Organization: Paradise Net Ltd. Customer
Lines: 16
Message-ID: <36DD0FD3.815AB2@paradise.net.nz>
References: <7bi9m6$2m8$1@nnrp1.dejanews.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: titan.xtra.co.nz 920439242 13670 203.96.152.5 (3 Mar 1999 05:34:02 GMT)
X-Complaints-To: newsadmin@xtra.co.nz
NNTP-Posting-Date: 3 Mar 1999 05:34:02 GMT
X-Mailer: Mozilla 4.5 [en] (WinNT; I)
X-Accept-Language: en
Cache-Post-Path: estelle.paradise.net.nz!unknown@d17.kelly.paradise.net.nz
X-Cache: nntpcache 2.3.3b4 (see http://www.nntpcache.org/)

>cjdavies1999@my-dejanews.com wrote:
>
>> I am looking for a DAYS_BETWEEN function, similar to the MONTHS_BETWEEN
>> function provided by Oracle.  I would also like to be able to have a more
>> general form of the ADD_MONTHS function, something like ADD_TO_DATE(
>> date_to_increment, increment ammount, increment_unit).

>I may be totally wrong but from my days using SAS for a date (Stored as >integer
>Number of days since...) you just subtract the two numbers to get the >difference.

>If it is a datetime value convert to a date first.

Oops.  Dates are always datetime....  I did a function (MOD I think) to
convert DATETIME to dates at midnight.  eg MOD (Seconds in day).

Regards
