Q&A about the site for software quality control experts, automation engineers, and software testers
SELECT DATEADD(week, DATEDIFF(week, 0, CreationDate), 0) AS OnDate, Count(DISTINCT IIF(PostTypeId = 1, Id, NULL)) AS Questions, Count(DISTINCT IIF(PostTypeId = 2, Id, NULL)) AS Answers FROM Posts WHERE PostTypeId IN (1, 2) -- AND CreationDate >= '2022-01-01' GROUP BY DATEADD(week, DATEDIFF(week, 0, CreationDate), 0) ORDER BY DATEADD(week, DATEDIFF(week, 0, CreationDate), 0)