Public Function PreviousDayOfWeekOnOrBefore( _ ByVal vDate As Variant _ , ByVal vDayOfWeek As Variant _ ) As Variant
Format$(#4/15/1996#, "ddd") = "Mon" PreviousDayOfWeekOnOrBefore(#4/15/1996#, vbMonday) = #4/15/1996# PreviousDayOfWeekOnOrBefore(#4/15/1996#, vbSunday) = #4/14/1996# PreviousDayOfWeekOnOrBefore(#4/15/1996#, vbFriday) = #4/12/1996# PreviousDayOfWeekOnOrBefore(#4/15/1996#, vbTuesday) = #4/09/1996# PreviousDayOfWeekOnOrBefore(#4/15/1996#, #4/16/1996#) = #4/09/1996#See also:
PreviousDayOfWeek Function NextDayOfWeekOnOrAfter Function vbSunday Property, et. al.vDate: The date whose current or previous specific day of the week is returned. Function returns Null if vDate is Null or cannot be fixed up to a Date.
FirstDayOfWeek = PreviousDayOfWeekOnOrBefore(vDate, vbSunday)
Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.