Information générale
Catégorie:
Codage, syntaxe et commandes
J'aime (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.
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement