Users with 200+ rep days

1

Please login or register to vote for this query.

(click on this box to dismiss)

Moderators

Q&A for community managers, administrators, and moderators

SELECT vt.DisplayName
    , DaysAbove200 = COUNT(vt.VoteDate)
FROM (
SELECT VoteNums.DisplayName
    , VoteNums.VoteDate
FROM (
SELECT u.DisplayName
    , VoteDate = CONVERT(DATE, v.CreationDate)
    , VoteRep = CASE vt.Name 
        WHEN 'AcceptedByOriginator' THEN 15
        WHEN 'UpMod' THEN 10
        WHEN 'DownMod' THEN -2
        ELSE 0
      END
FROM dbo.Users u
    INNER JOIN dbo.Posts p ON (u.Id = p.OwnerUserId) 
    INNER JOIN dbo.Votes v ON p.Id = v.PostId
    INNER JOIN dbo.VoteTypes vt ON v.VoteTypeId = vt.Id
    ) VoteNums
GROUP BY VoteNums.DisplayName
    , VoteNums.VoteDate
HAVING SUM(VoteNums.VoteRep) >= 200
) vt
GROUP BY vt.DisplayName
ORDER BY COUNT(vt.VoteDate) DESC;

Enter Parameters

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