I would like to get a year number - week number (f.i. 2021-01) using the ISO weeks count. I did manage to get both of them seperate using the following code:
IsoWeek:
(datepart(ISOWK, [Date]))
IsoYearNumber:
YEAR(DATEADD(day, 26 - DATEPART(isoww, [Date]), [Date]))
However, when I try to combine them into the YYYY-WW format using the line below I will get strange values like 2073 for 2020 WK 53.
(YEAR(DATEADD(day, 26 - DATEPART(isoww, [Date]), [Date]))) + '-' + (datepart(ISOWK, [Date]))
What should I change in the line above to get the ISO Year and Week in the YYYY-WW format? Thanks for the help in advance!