Q&A for professional and enthusiast programmers
SELECT (datepart(yy, p.creationdate) + (datepart(wk, p.creationdate)-1) / 52.0) as YR_WK, Min(Len(p.Body)) AS [Min], Avg(Len(p.Body)) AS [Average], Max(Len(p.Body)) AS [Max] FROM Users u, Posts p WHERE p.PostTypeId = 2 and p.score>0 and p.creationdate>='2015-01-01 00:00' GROUP BY (datepart(yy, p.creationdate) + (datepart(wk, p.creationdate)-1) / 52.0) ORDER BY (datepart(yy, p.creationdate) + (datepart(wk, p.creationdate)-1) / 52.0)