Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Function numWorkDays(StartDate As Date, EndDate As Date) As Integer
' This function calculates the number of workdays between StartDate and EndDate
' The work week is defined as Monday through Friday.
' The function does not exclude holidays.
Dim i As Date
For i = StartDate To EndDate
If (Weekday(i, 1) <> 1) And (Weekday(i, 1) <> 7) Then
numWorkDays = numWorkDays + 1
End If
Next i
End Function
SELECT Work_Days([Begdate], [Enddate]) As NumWorkDays, ... FROM yourtable...
SELECT numWorkDays([startdate], [enddate]) As NumWorkDays, ... FROM yourtable...