Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create calendar object for 2nd sunday of month

Status
Not open for further replies.

NWHippie

Programmer
Jul 27, 2007
5
0
0
US
Hi all. I'm trying to figure out how to create a calendar or a date object for the 2nd Sunday of a certain month. I can't figure out how to do it.
 
I think you have to create a calendar object, then use the DAY_OF_WEEK_IN_MONTH field to find out what the month starts with, compute the first Sunday, and add 7.

_________________
Bob Rashkin
 
For the first Sunday in month, the smallest possible value is the 1. day in month - the biggest is 7.
Therefore the 2nd Sunday has to be something between day 8 to 15.

Check out day-of-week for Day 8, and add some days accordingly.

don't visit my homepage:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top