This is a wonderful bit of code. Pity I didn't find it about 4 hrs ago 🙂 . Just 1 thing. If I want the WeekOfMonth to start on a Monday, Where and how do I need to alter the code. I can see it is somewhere in lines 142 , 143 "
, DATEPART(ww,@Date) + 0 - -----changed to set Monday as Day 1
DATEPART(ww,CAST(DATEPART(mm,@Date) AS VARCHAR) + '/1/' + CAST(DATEPART(yy,@Date) AS VARCHAR)) [WeekOfMonth]"
and as you can see I have tried with amending the + but no luck.
What I am trying to achieve is having the week of Month set to 1 for the first full week of the Mmonth starting from the fisrt Monday.
Once again, excellent code and please advise.
Nick