Advertisement
2002VB Math #25589

Week Ending Date

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

AI

AI Summary: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Source Code
original-source
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
Original Comments (3)
Recovered from Wayback Machine