Number of closes per week the last year


Please login or register to vote for this query.

(click on this box to dismiss)


Q&A for active researchers, academics and students of physics

-- This will compute the number of closed questions per week for the last year

  datepart(week, ClosedDate) AS [Week], 
  COUNT(*) AS [Number of Closed Questions]
FROM Posts
WHERE PostTypeId = 1 -- question
  AND ClosedDate IS NOT NULL
  AND DATEDIFF(DAY, ClosedDate, GETDATE()) < DATEDIFF(DAY, 'Jan 1, 2015', GETDATE())
GROUP BY datepart(week, ClosedDate)
ORDER BY datepart(week, ClosedDate)

Enter Parameters

Switch sites:
loading Hold tight while we fetch your results