select dateadd(week, datediff(week, 0, creationdate), 0),...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Programmers

Q&A for expert programmers interested in professional discussions on software development

select dateadd(week, datediff(week, 0, creationdate), 0), 
sum(case when closeddate is null then 1 else 0 end) as [Open],
sum(case when closeddate is null then 0 else 1 end) as [Closed]
from posts
where creationdate >= '1/1/2010' and posttypeid = 1
group by dateadd(week, datediff(week, 0, creationdate), 0)
order by dateadd(week, datediff(week, 0, creationdate), 0)

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results
:records returned in :time ms:cached