SELECT DATEADD(week, DATEDIFF(week, 0, CreationDate), 0) ...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Software Quality Assurance and Testing Meta

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)

Enter Parameters

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