Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Determining the start and end dates of a given week
Message
From
08/12/2003 06:01:08
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Determining the start and end dates of a given week
Miscellaneous
Thread ID:
00856775
Message ID:
00856775
Views:
61
Hi,

How can I determine the dates of the first and the last days in a week, given the week number, the year and the month where it occurs?

Examples:
December, 2003, week #50: first day's date: dec,  7, 2003
                          last  day's date: dec, 13, 2003

December, 2003, week #51: first day's date: dec, 14, 2003
                          last  day's date: dec, 20, 2003

December, 2003, week #52: first day's date: dec, 21, 2003
                          last  day's date: dec, 27, 2003

December, 2003, week #01: first day's date: dec, 28, 2003 (this week is split between two months, and years)
                          Last  day's date: jan, 03, 2004
                          
January , 2004, week #01: first day's date: dec, 28, 2003 (see example above)
                          Last  day's date: jan, 03, 2004
                          
January , 2004, week #02: first day's date: jan, 04, 2003
                          Last  day's date: jan, 10, 2004
Note: To determine the number of a week, given a date, I'm using: nWeek = Week (dGivenDate, 1, 1) (First week contains January 1st, first day of week is Sunday).

Thanks for any help,

Fernando
Next
Reply
Map
View

Click here to load this message in the networking platform