aobermueller (8/7/2013)
I'd just alter the Order By and call it good.---------------------------------------------------------
SELECT [Month] = DATENAME(mm,SomeDateTime),
Amount = SUM(SomeAmount)
FROM #MyHead
WHERE SomeDateTime >= '2010' AND SomeDateTime < '2011'
GROUP BY DATENAME(mm,SomeDateTime)
ORDER BY MAX(DATEPART(mm,SomeDateTime))
Not sure what MAX will do to performance. You might want to test it using the test harness I posted a couple of posts back.
--Jeff Moden
Change is inevitable... Change for the better is not.