select DisplayName, --DATEPART(wk, Votes.CreationDate) as...


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, --DATEPART(wk, Votes.CreationDate) as VoteWeek, 
  year(Votes.CreationDate) as VoteYear, 
  --DATEPART(wk, Votes.CreationDate) as VoteWeek,
  DATEPART(hour, Votes.CreationDate) as VoteHour,
  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, 
  --DATEPART(wk, Votes.CreationDate)
  DATEPART(hour, Votes.CreationDate)
--order by year(Votes.CreationDate) desc, 
--  DATEPART(hour, Votes.CreationDate) desc

Enter Parameters

Switch sites:
loading Hold tight while we fetch your results