• I made use of the built-in datepart functions available in SQL, as many of you also demonstrated. I used a sub-query to obtain the same results. If you want to select multiple years, in the Where clause you simply use the "in" instead of "=" operator.

    SELECT

    [Month]

    ,[Amount] = SUM([Amount])

    FROM

    (

    SELECT

    [SortMonth] = MONTH(SomeDateTime)

    ,[Month] = DATENAME(mm,SomeDateTime)

    ,[Amount] = SomeAmount

    FROM #MyHead

    WHERE YEAR(SomeDateTime) = 2010

    ) a

    GROUP BY [Month], [SortMonth]

    ORDER BY [SortMonth]