SELECT dateadd(day, datediff(day, 0, creationdate), 0), S...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

SELECT 
  dateadd(day, datediff(day, 0, creationdate), 0),
  SUM(CASE WHEN votetypeid = 2 THEN 1 ELSE 0 END) 'Approve',
  SUM(CASE WHEN votetypeid = 3 THEN 1 ELSE 0 END) 'Reject',
  100 * SUM(CASE WHEN votetypeid = 2 THEN 1 ELSE 0 END) / COUNT(*) 'Approval %'
  FROM suggestededitvotes
  WHERE creationdate > '2016-09-01'
  GROUP BY dateadd(day, datediff(day, 0, creationdate), 0)
  ORDER BY dateadd(day, datediff(day, 0, creationdate), 0) DESC

Enter Parameters

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