Working Days Again!!

zashmore

Registered User.
Local time
Today, 20:15
Joined
Apr 21, 2008
Messages
21
Hi All,

I have searched, and searched again but what I need is not here, unless I am being a plank. (Which is highly probable!!)

I can find out how to query working days between two dates but what I need is slightly different.

My staff fill in a spreadsheet at the moment with the visits they have done for the month.
I need to know how many working days are in the month, every month.

Any ideas??

Thanks
 
Hi -

Try this:

Code:
Public Function GetWkDays(pmoyr As String) As Integer
'************************************************
'Purpose:   Compute number of workdays (Mon - Fri)
'           in the specified mm/yyyy
'Coded by:  raskew
'Inputs:    1) ? GetWkdays("02/2008")
'           2) ?  GetWkdays("07/2008")

'Output:    1) 21
'           2) 23
'************************************************

Dim dteStart As Date
Dim dteEnd   As Date

   dteStart = DateValue(pmoyr)
   dteEnd = DateAdd("m", 1, dteStart) - 1

   GetWkDays = 7 - WeekDay(dteStart) + 5 * (DateDiff("ww", dteStart, dteEnd) - 1) + WeekDay(dteEnd) - 1

End Function

HTH - Bob
 

Users who are viewing this thread

Back
Top Bottom