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)

Internet of Things Meta

Q&A about the site for builders and users of networked sensors and control devices in the contexts of smart homes, industry automation, or environmental sensors

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 sites:
loading Hold tight while we fetch your results