I know how to determine the day of the week a date falls on. However, I was wondering if there was an easy way to figure the following information: 02/01/10 was the 5th Monday of year 2010, 01/07/11 is the 1st Friday of 2011, etc.?

Answer Wiki

Are you asking for a routine to deterime the n occurnace of a day of the year.
4th Sat, 21st Mon, 17 Tues, … ?
If so, determine day of week for Jan 1st of the requester year.
If day of week does not equal the day of week your looking for (1st is a Tues an you are looking for Fri), add x days to this date. where x is the differential. In the above case it would be 3 (Wed, Thur, Fri).
Now multiple n * 7 and add that number of days to your result date from above.
That would give you what you want.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States.
Privacy

Processing your response...

Discuss This Question: 2 &nbspReplies

There was an error processing your information. Please try again later.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States.
Privacy

The WEEK() and WEEK_ISO() functions might be of use in doing such date manipulation. Read the SQL documentation on the functions and make sure that you understand what the definition of a "week number" is. You'll want to be sure that your company's use of a "week number" matches with standards.
Tom

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States.
Privacy

Processing your reply...

Ask a Question

Free Guide: Managing storage for virtual environments

Complete a brief survey to get a complimentary 70-page whitepaper featuring the best methods and solutions for your virtual environment, as well as hypervisor-specific management advice from TechTarget experts. Don’t miss out on this exclusive content!

To follow this tag...

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States.
Privacy