Viewing 5 posts - 1 through 5 (of 5 total)
Thanks for following up and testing the different solutions Jeff - makes for interesting reading. The personal lesson for me from this is "test your code before posting". That way...
August 13, 2013 at 7:50 am
#1640938
Harveysburger (12/10/2010)
SELECT [Month] = DATENAME(mm, DATEADD(mm, MONTH(SomeDateTime), 0)), Amount = SUM(SomeAmount)
FROM #MyHead
WHERE SomeDateTime...
December 13, 2010 at 1:26 am
#1261558
Geoff A (11/15/2010)
N.North (11/15/2010)
November 15, 2010 at 7:31 am
#1250733
Kristian Ask (11/15/2010)
hugo-939487 (11/15/2010)
SELECT [Month] = DATENAME(mm,SomeDateTime),
Amount = SUM(SomeAmount)
...
November 15, 2010 at 7:04 am
#1250706
You could go for casting the month numbers to names in the select rather than in the ORDER BY clause, as it allows you to use MONTH in most places,...
November 15, 2010 at 1:44 am
#1250570