Skip to content

Instantly share code, notes, and snippets.

@adamjforster
Created October 21, 2010 10:31
Show Gist options
  • Save adamjforster/638268 to your computer and use it in GitHub Desktop.
Save adamjforster/638268 to your computer and use it in GitHub Desktop.
Add a number of working days to a given date.
<%
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