select dateadd(month, datediff(month, 0, p.CreationDate),...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

select dateadd(month, datediff(month, 0, p.CreationDate), 0) month,
  count(iif(p.Score<=0, 1, null))*100.0/count(*) PctNotPositive
from PostsWithDeleted as p
where p.PostTypeId = 1 -- question
group by dateadd(month, datediff(month, 0, p.CreationDate), 0)
order by dateadd(month, datediff(month, 0, p.CreationDate), 0)

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results