Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Get a date from a week number
Message
From
03/09/2019 21:48:19
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01670557
Message ID:
01670561
Views:
55
Likes (1)
>Hi all,
>I've a report based on week numbers. the week ends on a Friday but that's not an issue. However I need to also get the same week number last year, so I have >week 35 and I need to get week 35 last year. What I'm looking for is the Friday date in week 35 last year. The reason is that I need to then get the previous 10 >weeks and the report may have to run over year so I think getting the Friday and working backwards is the best way.
>Any ideas? I can do it with brute force but looking for something elegant and fast if possible.
>~M

I would suggest getting the day-of-week for 1-Jan of the previous year. Then add 35 weeks or 7 * 35 days to get the day-of-week and then add/subtract based on what day Friday is in relation to the day-of-week.
Previous
Reply
Map
View

Click here to load this message in the networking platform