I have a table that holds monthly data in it. I need to average that data into Quarterly and Annual data but I'm not sure how to go about that. For annual I tried something like:
SELECT TOP (100) PERCENT b.vSeries_Type as [Description],b.vSeries_Number as [CANSIM], Year(a.IPI_Ref_Date)as [Year], avg(a.IPI_Value) as [IPI] FROM dbo.tblIPI AS a INNER JOIN dbo.tblVSeriesList AS b ON a.IPIvSeries_ID = b.vSeries_ID AND (b.vSeries_Number = 'v53384920' OR b.vSeries_Number = 'v53384879' OR b.vSeries_Number = 'v53433827' OR) group by b.vSeries_Type,b.vSeries_Number,a.IPI_Ref_Date ORDER BY b.vSeries_Number asc
However the output is definitely not Annual, I don't know exactly what the calculation did. Can someone point me in the right direction?