• SELECT [Month] = DATENAME(mm,SomeDateTime),Year(Somedatetime),

    Amount = SUM(SomeAmount)

    FROM #MyHead

    GROUP BY DATENAME(mm,SomeDateTime),Year(Somedatetime)

    ORDER BY CAST(DATENAME(mm,SomeDateTime) + ' 1900' AS DATETIME),Year(Somedatetime)

    james.wheeler10 (11/15/2010)


    What happens when you're reporting on a period greater than a year?

    Won't both of the overlapping month's figures will be aggregated into a single month aggregate total?