Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Week 1 of 2019
Message
From
28/12/2018 17:39:36
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
01664931
Message ID:
01664934
Views:
66
>Hi,
>
>In my application Week Number is a very important concept. And from the beginning of the app (many years ago), in my code, I always considered week by Monday of the week. That is, a week should have Monday.
>Next year, 2019, is a little challenging. The 1st of January falls on Tuesday. So, my app will consider the first week to be Week of January 7th (first Monday). But I know that many customers will not accept it (or at least will not understand it). And they will still think of the week of December 31 of 2018 as the first week of 2019.
>I can change it in code (I think) and have the program re-calculate the 1st week and then always, when looking for a week #, to take into account that the first week was actually not the full week.
>
>Do you think that I should just stick to my initial design and have the week of January 7th, 2019 to be the first week of the year? Or re-calculate (kind of late but I can do it).
>
>TIA

Let me come at this from a different angle - you mentioned you're talking about changing the code. So I'm assuming you have code in the application that is driving the date aggregations.

I always create a date dimension table (a calendar table) with 1 row per date and columns for what that date represents.

So the table might have a date column, date description, day of week, day of month, fiscal week, month to which it belongs, quarter, etc. And since I've had applications that had to support multiple date hierarchies (like a fiscal definition and a regular calendar definition), it might mean sets of columns.

I know that doesn't answer your initial question, but just wanted to make that suggestion. Abstracting all of that into a table with the necessary columns usually makes reporting easier.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform