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

0

Please login or register to vote for this query.

(click on this box to dismiss)

Software Engineering

Q&A for professionals, academics, and students working within the systems development life cycle

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/2011'
group by dateadd(week, datediff(week, 0, creationdate), 0)
order by dateadd(week, datediff(week, 0, creationdate), 0)

Enter Parameters

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