Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Strange behavior of the week function
Message
From
30/07/2004 00:10:12
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00929454
Message ID:
00929468
Views:
8
>Why WEEK({^2004-12-31}) return 1 instead of 53

In Bata/Bolivia, I couldn't quite figure out if there was a well-defined rule, how the week numbering was defined in the company (i.e., which was the first week of the year). So, to have the maximum flexibility, I ended up creating a table, indicating which was the first week of each year (weeks stored as the date of the first day of the week, of week #1), and functions to convert from dates to week numbers, and back again, with the help of this table.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform