Actually, that was a mistake that I fixed. Change the line "1 AS MonthPart" in CTE1 to "2 AS MonthPart".
I hadn't realized what the CTE was doing when I first logged this message.
The string of months is not the important part.
What is important is not being able to assign it to a local variable inside a CTE so I can either use it later and/or use it in the outer query without having recalculated each time.
Thanks,
Tom