Re: Number of days between two dates

From: jack <jalford_at_immcms1.redstone.army.mil>
Date: 1995/09/21
Message-ID: <jalford.390.001C4728_at_immcms1.redstone.army.mil>#1/1


In article <43sbk7$bi4_at_Vir.com> d_andrade_at_vir.com (Dalton M. de Andrade) writes:
>From: d_andrade_at_vir.com (Dalton M. de Andrade)
>Subject: Number of days between two dates
>Date: Thu, 21 Sep 1995 18:51:27 GMT
 

>I need to count the number of week days (also excluding holidays) between two
>given dates.
 

>Any suggestions on how to do this would be much appreciated.
 

>Thanks,

use the 'months_between' function it is based on a 31-day month but other than having a lookup table that has the actual number of days in each month, this is the easiest way. Something like:

 Select months_between(date1,date2) from dual;

this will tell you a fractional number of months between the two dates, you could also multiply the result times 31 and truncate it or whatever to get close to the actual number of days...

But the lookup table with corresponding functions is the much more accurate method.

 hope it helps !!

  • jack
Received on Thu Sep 21 1995 - 00:00:00 CEST

Original text of this message