Excluding weekend days

Withnail

New member
Local time
Today, 02:55
Joined
Apr 5, 2001
Messages
7
Hello all

I am having a few ideas about a new database, and one of the issues I've encountered has perplexed me.

How would I calculate the number of days elapsed between [Date_work_assigned] and [Date_Work_Completed] but excluding Weekend days.

Withnail
 
there may be other shortcuts but here's a simple one:

Public Function ReturnDays() as Date

Dim intDays As Integer
Dim dtDateLoop As Date

intDays = 0
For dtDateLoop = Me ("[Date_work_assigned]") To Me("[Date_Work_Completed]")
If WeekDay(dtDateLoop) <> 1 Then intDays = intDays + 1 '1 is sunday considering the default parameter
Next

ReturnDays = intDays

End Function


[This message has been edited by joeyreyma (edited 07-05-2001).]

[This message has been edited by joeyreyma (edited 07-05-2001).]
 

Users who are viewing this thread

Back
Top Bottom