## User Tag List

Hi there
I really hope you guys can assist me with this.
I am writing a call logging system, .....no problem.

PROBLEM
I have to query the db ( access) to find out how long it took to close the call.
Between startdate and enddate
It must count only workdays, no weekends (holidays is not a problem).
using asp

Please ...does anyone have any idea.

"I'm stuck"

Thank you
Albert

2. I'm not saying there's no easier way, but...

You should definitely learn how to use the Weekday function:
http://msdn.microsoft.com/library/en...fctWeekday.asp

and the DateDiff function:
http://msdn.microsoft.com/library/en...ctDateDiff.asp

Simply put, you could find the number of weeks between the two dates, subtracting 2 for each week, then using a secondary calculation involving the number of biz days floating around the first date and then again around the 2nd date.

If you are worried about the accuracy of such calculations, maybe you could simply do a loop from 1 to n where n is the #of days diff between the start and end dates. Each time you go through the loop, calculate the day of the week of the nth day since the first call. For each business day (weekday fn is between mon-fri), keep count using "bizday = bizday + 1" and then increment n so that the next time you go through the loop, you're calculating the dayofweek of the next day since the first call. When you get to the end date, your sum should be ready.

Dan

3. Or:

NumOfWeekdays = DateDiff("w", Date1, Date2)

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•