Q&A for professional and enthusiast programmers
SELECT 52 * DATEPART(year, v.CreationDate) + DATEPART(week, v.CreationDate) AS [WeekNum], COUNT(v.Id) AS [Count] FROM Votes AS v WHERE v.VoteTypeId IN (2, 3) -- UpMod, DownMod GROUP BY 52 * DATEPART(year, v.CreationDate) + DATEPART(week, v.CreationDate) ORDER BY [WeekNum] DESC