FirstDateOfDayInYear

Syntax:

FirstDateOfDayInYear(dateexpr, NumZ{day})

Description:
Returns the date of the first instance of the specified day in the year of the date specified.  For example, this function could return the date of the first Monday of next year .

Parameter Description

dateexpr A the date to be used when determining the first instance of the day.

NumZ{day}  The day to check for.

• vbSunday (1) - Sunday

• vbMonday (2) - Monday

• vbTuesday (3) - Tuesday

• vbWednesday (4) - Wednesday

• vbThursday (5) - Thursday

• vbFriday (6) - Friday

• vbSaturday (7) - Saturday

Example:

Sub Main
'return the date of the first Sunday of this year.
  firstSundayofthisyear = FirstDateOfDayInYear(Now(),1)

'return the date of the first Monday of next year.
  firstMondayofnextyear = FirstDateOfDayInQuarter(DateAdd(1, "yyyy" ,Now()),2)



End
Sub

See Also:

IsLeapYear

FirstDateOfDayInMonth

FirstDateOfDayInQuarter

FirstDateOfDayInYear

LastDateOfDayInMonth

LastDateOfDayInQuarter

LastDateOfDayInYear

LastDateOfWeek

LastDayOfMonth

LastDayOfQuarter

LastDayOfYear