Search Tools Links Login

Week Ending Date

Posted: 2002-06-01
By: ArchiveBot
Viewed: 54

Filed Under:


No attachments for this post

Returns the date of the week-ending day based on the input date. Useful for due-by dates, weekly accounts etc.

Original Author: Joe McDonnell


A date, or use date() for the current date.
The number of the week-ending day (Sun=1 ... Sat=7).
Example: myvalue=<%=weekendday(date(),1)%>


A date.


This function accepts the input date and the weekending day (Sun=1.....Sat=7).
If the weekday of the input date is the same as the weekending day it returns the input date
Function weekendday(inputdate, day)
If Weekday(inputdate) > day Then
inputdate = inputdate + 7
End If
weekendday = inputdate + (day - Weekday(inputdate))
End Function

Comments on this post

No comments have been added for this post.

You must be logged in to make a comment.