Query to get the last seven week number of the year in particular for pivot.
Suppose today is 44th week then my output should be [44],[43],[42],[41],[40],[39],[38]

select datepart(ww,getdate())
1 Like

But with this query i won't get the format which i want

You get the weeknumbers you want, right?
Now if you want to incorporate it in your query, you might want to post your query. Otherwise it's hard to help.

1 Like