Epic

0

Please login or register to vote for this query.

(click on this box to dismiss)

Audio-Video Production Meta

Q&A about the site for engineers, producers, editors, and enthusiasts spanning the fields of video, and media creation

/***Number of Day you hit the Reputation Cap ***/
DECLARE @UserID int 
Set @UserID = 41596;
WITH BaseQuery AS (
SELECT dateadd(dd,0, datediff(dd,0, v.CreationDate)) as Day, SUM(CASE when VoteTypeId=1 then 15 when VoteTypeId=2 then 10 else -2 end) as Reputation 
FROM votes v
INNER JOIN posts p on p.Id=v.PostId And p.CommunityOwnedDate is null
WHERE v.VoteTypeId=2 and p.OwnerUserId=@UserID 
GROUP BY dateadd(dd,0, datediff(dd,0, v.CreationDate))
HAVING SUM(CASE when VoteTypeId=1 then 15 when VoteTypeId=2 then 10 else -2 end) >= 200)

SELECT count(*) FROM BaseQuery

Enter Parameters

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