Created
October 21, 2010 10:31
-
-
Save adamjforster/638268 to your computer and use it in GitHub Desktop.
Add a number of working days to a given date.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% | |
Function add_working_days(start_date, to_add) | |
For days = 0 To to_add - 1 | |
start_date = DateAdd("d", 1, start_date) | |
If DatePart("w", start_date) = 1 Then | |
start_date = DateAdd("d", 1, start_date) | |
ElseIf DatePart("w", start_date) = 7 Then | |
start_date = DateAdd("d", 2, start_date) | |
End If | |
Next | |
add_working_days = start_date | |
End Function | |
%> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment