Q&A about the site for serious players and enthusiasts of poker
---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