[AccessD] First / last day of week

JWColby jwcolby at colbyconsulting.com
Mon Jan 15 11:57:38 CST 2007


Has anyone got more efficient code than the following?
 
Function DteFirstDayOfWeek(dte As Date) As Date
Dim intDOW As Integer
    intDOW = Weekday(date, vbUseSystemDayOfWeek)
    DteFirstDayOfWeek = date - (intDOW - 1)
End Function

Function DteLastDayOfWeek(dte As Date) As Date
Dim intDOW As Integer
    intDOW = Weekday(date, vbUseSystemDayOfWeek)
    DteLastDayOfWeek = date + (7 - intDOW)
End Function
 
John W. Colby
Colby Consulting
www.ColbyConsulting.com
 



More information about the AccessD mailing list