Find Last Day of Week |
Question:
How do you find last Monday? I want to return a date for last Monday or today if today is Monday.
|
Answer:
While Weekday(ADate) <> vbMonday ADate = DateAdd("d", -1, ADate) WEnd
You could wrap this up in a function as follows: Function SU_GetLastDOW(ADate, AWeekDayConst) While Weekday(ADate) <> AWeekDayConst ADate = DateAdd("d", -1, ADate) WEnd SU_GetLastDOW = ADate End Function
|
0 Comments.
Share a thought or comment...
KB Article #100713 Counter |
14959 |
Since 4/2/2008
|
|