... quarter for 2008: SELECT DATEPART(qq, SalesDate) AS [Quarter],Count(*) as Count,Sum(Amount) as [Sum],Avg(Amount) as [Avg]FROM RawDataWHERE Year(SalesDate) = 2009GROUP BY ALL DATEPART(qq, SalesDate);Result:Quarter ... sections describe ways to create the same result.Pivot method Microsoft introduced the PIVOT method for coding crosstab queries with SQL Server 2005. The pivotmethod deviates from the normal logical ... deprecated. The syntax stillworks for now, but they will be removed from a future version of SQL Server. This sectioncovers only the newer syntax — it’s much cleaner and offers more control....