Ross
Here's something that I downloaded from somewhere (don't know where) recently.
It may help point to something for you.
Tom
CALCULATING WORK DAYS: (Place these in a module)
Function CalcWkDays(dteStartDate As Date, dteEndDate As Date) As Integer
'input: (from debug window) ? CalcWkDays(#01/01/01#, #07/01/01#)
'output: 129
'
Dim X As Integer
'
X = DateDiff("d", dteStartDate, dteEndDate) - 2 * DateDiff("ww", dteStartDate, dteEndDate) _
+ IIf(WeekDay([dteStartDate]) = 7, 1, 0)
CalcWkDays = X
End Function
'
Function CalcWkDays2(dteStartDate As Date, dteEndDate As Date) As Integer
'input: (from debug window) ? CalcWkDays2(#01/01/01#, #07/01/01#)
'output: 129
'NOTE:As written,this counts both start and end dates.
'
Dim n As Integer
n = 0
'
Do While dteStartDate <= dteEndDate
'17 in the following expression represents the numeric days of week for Sunday(1) and Saturday (7). It can
'be modified to exclude any specified days of the week.
n = n + IIf(InStr("17", WeekDay(dteStartDate)) = 0, 1, 0)
'
dteStartDate = dteStartDate + 1
'
Loop
'
CalcWkDays2 = n
End Function