New and finished reviews per day

1

Please login or register to vote for this query.

(click on this box to dismiss)

The Great Outdoors

Q&A for people who love being outdoors enjoying nature and wilderness, and learning about the required skills and equipment

---since the table ReviewTasks contains only date, we don't get any information about hours/minutes
---ReviewTaskTypeId
---1 = Suggested Edit
---2 = Close Votes
---3 = Low Quality Posts
---4 = First Post
---5 = Late Answer
---6 = Reopen Vote
;with new_cte AS (SELECT 
  CreationDate AS NDate,
  COUNT(Id) AS NCount
FROM ReviewTasks
WHERE (ReviewTaskTypeId=##type?2##)
GROUP BY CreationDate),
done_cte AS (SELECT
  DeletionDate AS DDate,
  COUNT(Id) AS DCount
FROM ReviewTasks
WHERE (ReviewTaskTypeId=##type##)
GROUP BY DeletionDate)

SELECT
  n.NDate,
  n.NCount AS [New review tasks],
  d.DCount AS [Finished review tasks]
FROM new_cte n INNER JOIN done_cte d ON n.NDate=d.DDate
WHERE (n.NDate >= '##Date1?2020-01-01##') AND (n.NDate <= '##Date2?2021-01-01##')
ORDER BY n.NDate

Enter Parameters

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