Q&A for Drupal developers and administrators
SELECT eomonth(q.CreationDate) AS [Month], COUNT(q.Id) AS [Total Count], SUM(Case When q.DeletionDate IS NULL Then 1 Else 0 End) AS [# Not Deleted] FROM PostsWithDeleted q WHERE (q.CreationDate >= '##Date1?2000-01-01##') AND (q.CreationDate <= '##Date2?2021-01-01##') AND (q.PostTypeId=##type?1##) ---PostTypeId=1 means only questions GROUP BY eomonth(q.CreationDate) ORDER BY eomonth(q.CreationDate)