Number of questions per day (between two dates)

1

Please login or register to vote for this query.

(click on this box to dismiss)

Cognitive Sciences Meta

Q&A about the site for practitioners, researchers, and students in cognitive science, psychology, neuroscience, and psychiatry

; with counts_cte AS (
SELECT
  CAST(CreationDate AS DATE) AS CDate,
  COUNT(q.Id) AS CCount,
  SUM(Case When q.DeletionDate IS NULL Then 1 Else 0 End) AS CCountND
FROM PostsWithDeleted q
WHERE (q.PostTypeId=1)
---only questions  
GROUP BY CAST(CreationDate AS DATE)
)

SELECT
  CDate AS [Date],
  CCount AS [Total Count],
  CCountND AS [# Not Deleted]
FROM counts_cte
WHERE (CDate >= '##Date1?2019-01-01##') AND (CDate <= '##Date2?2021-01-01##')
ORDER BY CDate

Enter Parameters

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