Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I need to get the corresponding day 52 weeks ago, so if I have a Tuesday I need to get the corresponding Tuesday 52 weeks ago ...
Since there is no method addweeks(DATE, -52), how is the best way to solve this issue?
Best regards
& thanks in advance
Stefan WALTHER
Hi Stefan,
Try this :
Date(YourDate - (52*7)) as SameDayLastYear
Obviously there is no need for AddWeek function because a week is always exactly 7 days...
you can also add Day# in Year to your master calendar, obviously this will vary on leap years but works great. I also add Business Day# in Year and you can even exclude business holidays
Hi There.
The solution is to employ the 'AddMonths' Function(AddMonths(startdate, n , [ , mode])) in your specific case.
I.e. You are trying this... >> addweeks(DATE, -52)
Rather try this... >> AddMonths(DATE, -12)
Kind regards.