Total rep gained on the site for posts not older than 30 days, by month

1

Please login or register to vote for this query.

(click on this box to dismiss)

Motor Vehicle Maintenance and Repair Meta

Q&A about the site for mechanics and DIY enthusiast owners of cars, trucks, and motorcycles

SELECT
  DATEFROMPARTS(YEAR(Votes.CreationDate), MONTH(Votes.CreationDate), 1)
    AS Month,
  SUM(
    CASE
      WHEN Votes.VoteTypeId = 1 THEN 15
      WHEN Votes.VoteTypeId = 2 THEN 10
      ELSE -2
    END) AS Rep
FROM Posts, Votes
WHERE
  Votes.PostId = Posts.Id
  AND
  DATEDIFF(day, Posts.CreationDate, Votes.CreationDate) BETWEEN 0 AND 30
  AND
  Votes.VoteTypeId <= 3
GROUP BY
  DATEFROMPARTS(YEAR(Votes.CreationDate), MONTH(Votes.CreationDate), 1)
ORDER BY Month DESC;

Enter Parameters

Options:
Switch to main site
loading Hold tight while we fetch your results