This will lead to some pretty miserable performance on top of it all... it makes for a 100% non-SARGable query. You could have a thousand index on the columns involved and the absolute best you'll ever get is an INDEX SCAN.
WHERE FORMAT(RegularTable.Date,'MM/yyyy') = FORMAT(##TempMonths.x,'MM/yyyy'))
I knew people would abuse the new FORMAT function as soon as I saw it. :sick:
--Jeff Moden
Change is inevitable... Change for the better is not.