Jump to content

Need the Date of ordinal Weekdays


Lynn Frieden

Recommended Posts

The first step is to get the first day of the month [First day of the month]:

Date(Year([MyDate]),Month([MyDate]),1)Based on this, the first Monday of the month can be calculated by:

DateAdd("day",6 - DayOfWeek(DateAdd("day",5,[First day of the month])),[First day of the month])Similarly, the second Monday is:

DateAdd("day",6 + 7 - DayOfWeek(DateAdd("day",5,[First day of the month])),[First day of the month])And the first Tuesday is:

DateAdd("day",6 - DayOfWeek(DateAdd("day",4,[First day of the month])),[First day of the month])

Link to comment
Share on other sites

I tested that as:Case when DateAdd("day",6 - DayOfWeek(DateAdd("day",5,[First day of the month])),[First day of the month]) then "First Monday"

when DateAdd("day",6 + 7 - DayOfWeek(DateAdd("day",5,[First day of the month])),[First day of the month]) then "Second Monday"

else "No" endI received an error "Invalid function call for 'If'"  Am I missing something

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...