Votes by Week

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

select DisplayName, 
  year(Votes.CreationDate) as VoteYear,
  DATEPART(wk, Votes.CreationDate) as VoteMonth,
  Count(Votes.Id) as VoteCount
from Users 
  inner join Posts on Users.Id = Posts.OwnerUserId 
  inner join Votes on Posts.Id = Votes.PostId
where Users.Id = 3347858
  and PostTypeId < 3 --1 is Question and 2 is Answer
  and VoteTypeId = 2
group by Users.DisplayName, 
  --Posts.Body, 
  year(Votes.CreationDate), 
  DATEPART(wk, Votes.CreationDate)
order by year(Votes.CreationDate) desc, 
  DATEPART(wk, Votes.CreationDate) desc

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results