Number of weekdays in the current month:

<cfparam name="DayCounter" default="0">
<cfparam name="DayHolder" default="01/01/1900" type="date">

<cfloop from="1" to="#DaysInMonth(Now())#" index="i">
        <cfset DayHolder = #CreateDate(Year(Now()),Month(Now()),i)#>
        <cfif DayOfWeek(DayHolder) GT 1 AND DayOfWeek(DayHolder) LT 7>
                <cfset DayCounter = #DayCounter# + 1>
        </cfif>
</cfloop>
<cfoutput>#DayCounter#</cfoutput>

Of course, this doesn't take into account holidays- what with everyone
having a different holiday schedule.  I would have a database lookup
table for this sort of thing.  If all you want is a final total, you
might just store MonthName and NumberOfHolidays.  Once you have your
number of weekdays, you can query the database for number of holidays in
that month, and subtract off.  

If you want to make your holiday table a little more useful and store
the individual dates of each holiday, you could use the Count() SQL
function to count the records returned for holiday dates in the current
month.

HTH

Matt Osbun
Web Developer
Health Systems, International



-----Original Message-----
From: Torrent Girl [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 25, 2005 1:30 PM
To: CF-Newbie
Subject: PLEASE HELP 


I need the # of biz days in current month

Thanks



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Protect Your PC from viruses, hackers, spam and more. Buy PC-cillin with Easy 
Installation & Support 
http://www.houseoffusion.com/banners/view.cfm?bannerid=61

Message: http://www.houseoffusion.com/lists.cfm/link=i:15:1010
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/15
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:15
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to