Days in which rep cap was reached + bounty was offered

0

Please login or register to vote for this query.

(click on this box to dismiss)

Meta Stack Exchange

Q&A for meta-discussion of the Stack Exchange family of Q&A websites

select CONVERT(varchar, Votes.CreationDate, 112) as [Date],
       sum(case 
           when PostTypeId = 1 and VoteTypeId = 1 then 2
           when PostTypeId = 1 and VoteTypeId = 2 then 5
           when PostTypeId = 2 and VoteTypeId = 1 then 15
           when PostTypeId = 2 and VoteTypeId = 2 then 10
           else 0
       end) as [Reputation Earned],
       sum(case when VoteTypeId = 8 then 1 else 0 end) as [Bounties Offered]
       
from Votes
left outer join Posts on Votes.PostId = Posts.Id
where (OwnerUserId = ##UserId## or UserId = ##UserId##)
  and (VoteTypeId = 1 or VoteTypeId = 2 or VoteTypeId = 8)
  and (PostTypeId = 1 or PostTypeId = 2 or VoteTypeId = 8)
group by CONVERT(varchar, Votes.CreationDate, 112)
having sum(case 
           when PostTypeId = 1 and VoteTypeId = 1 then 2
           when PostTypeId = 1 and VoteTypeId = 2 then 5
           when PostTypeId = 2 and VoteTypeId = 1 then 15
           when PostTypeId = 2 and VoteTypeId = 2 then 10
           else 0
       end) >= 200
order by [Date];

Enter Parameters

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