"Mike" <mo******@gmail.comwrote in message

news:eD****************@TK2MSFTNGP03.phx.gbl...

Is there a way to calculate the total number of weekdays when provided a

date?

Example:

If I have a start date of 7/11/2008 and I want to go out 10 days, I want

to get this:

6 weekdays

4 weekend days

Is something like this possible?

Simple enough with a bit of programming

Instantiate a DateTime variable from the starting date.

Set up a while loop which increases the DataTime variable using the

AddDays(1) method for the required number of iterations.

At each iteration, inspect the DataTime variable's DayOfWeek property. If it

equates to DayOfWeek.Saturday or DayOfWeek.Sunday, treat it differently from

the other days. Of course, not every culture considers Saturday and Sunday

to be the weekend, so you might need to check for that...

http://dotnetguts.blogspot.com/2007/...mespan-in.html
--

Mark Rae

ASP.NET MVP

http://www.markrae.net