I have a report with a date field and I am trying to add another field that will be 10 business days from the current field. So it needs to add 10 days while skipping weekends and holidays. Can anyone help??Maybe you could try a loop:
I don't know the right syntax, but you get the idea... Also, this doesn't count for Holidays.
DateVar dtmNewDate := {CurrentDate}
NumberVar DaysAdded := 1
Do Until DaysAdded = 11
dtmNewDate := DateAdd("D", 1, dtmNewDate)
If DayOfWeek (dtmNewDate) <> "Saturday" And DayOfWeek (dtmNewDate) <> "Sunday" Then
DaysAdded := DaysAdded + 1
End If
Loop
No comments:
Post a Comment