Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
SELECT DateAdd( "d", IIF( (WeekDay( theDate)>6),6,(6-WeekDay( theDate)) ), theDate ) AS Express
FROM
aTable
Public Function basCurWkDayDt(DtIn As Date, WkDay As Integer) As Date
'Michael Red Tek-Tips thread703-360132 9/16/02
Dim tmpDate As Date
Dim Offset As Integer
'Example Usage
'? basCurWkDayDt(Date, vbMonday)
'9/16/02
'? basCurWkDayDt(#8/21/2002#, vbMonday)
'8/19/02
'? basCurWkDayDt(Date, vbFriday)
'9/20/02
'Guess the date (coluld be wrong week)
tmpDate = DateAdd("d", 8 - Weekday(DtIn, WkDay), DtIn)
Offset = DatePart("ww", DtIn) - DatePart("ww", tmpDate)
basCurWkDayDt = DateAdd("ww", Offset, tmpDate)
End Function