Re: Number of days between two dates

From: Saad Ahmad <sahmad_at_mfa.com>
Date: 1995/09/21
Message-ID: <43shr0$d3d_at_homer.alpha.net>#1/1


Dalton M. de Andrade (d_andrade_at_vir.com) wrote:
> 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.

select to_date('30-SEP-95', 'DD-MON-YY') - to_date('01-SEP-95') from dual;
TO_DATE('30-SEP-95','DD-MON-YY')-TO_DATE('01-SEP-95')


                                                   29

when u want to exclude holidays, u mean Sat/Sun or things like 4th of July. I don't think Oracle provides a way to determine if its a holiday.

If latter is the case, I think you could create a table say CALENDER which lists each date in the year and a Y/N flag if its a holiday ...

--
**************************************************************
*                          Saad Ahmad                        *
*                          McHugh Freeman & Associates, Inc. *
*                          Ph:  (414) 798-8606 Ext. 457      *
*                          Fax: (414) 798-8619               *
*                          E-Mail: sahmad_at_mfa.com            *
**************************************************************
Received on Thu Sep 21 1995 - 00:00:00 CEST

Original text of this message