Answered questions vs. all questions per week

0

Please login or register to vote for this query.

(click on this box to dismiss)

Mathematics

Q&A for people studying math at any level and professionals in related fields

SELECT
  DATEPART(week,CreationDate),
  SUM(CASE when AnswerCount > 0 then 1 else 0 END) as Answered,
  COUNT(Posts.Id) as Total,
  CAST(SUM(CASE when AnswerCount > 0 then 1 else 0 END) as float)/COUNT(Posts.Id) as Ratio
  FROM Posts WHERE (PostTypeId=1 AND CreationDate >= '##Date1##' AND CreationDate <= '##Date2##')
GROUP BY DATEPART(week,CreationDate)
ORDER BY DATEPART(week,CreationDate) ASC

Enter Parameters

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