General information
Category:
Coding, syntax & commands
Likes (1)
Naomi Nosonovsky
>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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only