LastDateOfWeek

Syntax:

LastDateOfWeek(dateexpr, NumZ{day})

Description:
Returns the date of the last instance of the specified day in the week of the date specified.  

Parameter Description

dateexpr A the date to be used when determining the last instance of the day in the week.

NumZ{day}  The day to check for.

Example:

Sub Main
'return the date of the last Sunday of this week.
  lastSundayofthisweek = LastDateOfWeek(Now(),1)

'return the date of the last Friday of this week.
  lastMondayofthisweek = LastDateOfWeek(Now(),6)



End
Sub

See Also

IsLeapYear

FirstDateOfDayInMonth

FirstDateOfDayInQuarter

FirstDateOfDayInYear

LastDateOfDayInMonth

LastDateOfDayInQuarter

LastDayOfMonth

LastDayOfQuarter

LastDayOfYear