Accept votes
Q&A for professional and enthusiast programmers
select VX.YR_WK, COUNT(VX.id) from VoteTypes VT join (select V.VoteTypeId As VoteTypeId, (datepart(yy, V.creationdate) + (datepart(wk, V.creationdate)-1) / 52.0) as YR_WK, V.ID as ID from Votes V) VX on VX.VoteTypeId = VT.id AND VT.Name='UpMod' group by VX.YR_WK order by VX.YR_WK