The code that I've always seen is highly hacked. Here's the broad strokes.
I'm writing this as I go, you might have to modify a little for yours.
Heck, this code might not even work. But it does come close.
1) Count the number of weekend days.
If start_date is Sun, start_date=start_date-1
If start_date is Sat, start_date=start_date-1
If stop_date is Sun, stop_date=stop_date-1
If stop_date is Sat, stop_date=stop_date-1
weekends=(stop_date-start_date) Div 7 * 2
2) Keeps a table of the weekdday holidays. Count the number of entries
where the holiday date is between the target dates.
3) Count the number of days between the dates and subtract the number of
weekends and holidays.
days=stop-start-weekends-holidays
4) Count the hourly difference between the two times (note the differences
if one/both dates are on a weekend/holiday)
Broad strokes....
Brian
-----Original Message-----
From: Alex [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 22, 2001 11:24 AM
To: CF-Talk
Subject: Re: [RE: business dates]
i need to get the number of business dates/hours between 2 user defined
dates.
i am using SQLServer.
does anyone know how to do this?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists