percent deleted in time

0

Please login or register to vote for this query.

(click on this box to dismiss)

Robotics Meta

Q&A about the site for professional robotic engineers, hobbyists, researchers and students

Select 
(DATEPART(month, creationdate)-1.00)/12+DATEPART(year, creationdate)   as [Month],
   count(*) as [Count],
   sum(case when deletiondate is null then 1 else 0 end) as [Open],
   sum(case when deletiondate is null then 0 else 1 end) as [Deleted]
from postswithdeleted
group by (DATEPART(month, creationdate)-1.00)/12+DATEPART(year, creationdate) 
order by [Month]

Enter Parameters

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