FirstDateOfDayInQuarter

Syntax:

FirstDateOfDayInQuarter(dateexpr, NumZ{day})

Description:

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

Parameters:

Parameter

Description

dateexpr

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

 

The return integer is one of the following:

NumZ{day}

Value

Description

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 quarter.
  firstSundayofthisquarter = FirstDateOfDayInQuarter(Now(),1)

'return the date of the first Monday of next quarter.
  firstMondayofnextquarter = FirstDateOfDayInQuarter(DateAdd(1,"q",Now()),2)

EndSub


See Also:

IsLeapYear, FirstDateOfDayInMonth, FirstDateOfDayInYear, LastDateOfDayInMonth, LastDateOfDayInQuarter, LastDateOfDayInYear, LastDateOfWeek, LastDayOfMonth, LastDayOfQuarter, LastDayOfYear