hgus393
Registered User.
- Local time
- Today, 12:18
- Joined
- Jan 27, 2009
- Messages
- 83
Hi all,
I am racking my brain trying to solve this problem that I am having. I have a report that needs to be populated with 30 working days from a start date.
I have tried using this bit of code in a query but it does not work, ie it does not identify Saturdays and Sundays accordingly. can anyone see what I am doing wrong?


Bob
I am racking my brain trying to solve this problem that I am having. I have a report that needs to be populated with 30 working days from a start date.
I have tried using this bit of code in a query but it does not work, ie it does not identify Saturdays and Sundays accordingly. can anyone see what I am doing wrong?
Code:
Function WEEKDATUM(startD As Date, q As Integer)
'
Dim RappDatum As Date
If Weekday(startD + q) = 1 Then
RappDatum = q + startD + 1
Else: RappDatum = q + startD
End If
If Weekday(startD + q) = 6 Then
RappDatum = q + startD + 2
Else: RappDatum = q + startD
End If
WEEKDATUM = RappDatum
End Function
Bob