Q&A for expert programmers interested in professional discussions on software development
select dateadd(week, datediff(week, 0, creationdate), 0), sum(case when posthistorytypeid = 1 then 1 else 0 end) as [asked], sum(case when posthistorytypeid = 10 then 1 else 0 end) as [closed], sum(case when posthistorytypeid = 11 then 1 else 0 end) as [reopened], sum(case when posthistorytypeid = 12 then 1 else 0 end) as [deleted], sum(case when posthistorytypeid = 13 then 1 else 0 end) as [undeleted], sum(case when posthistorytypeid = 17 then 1 else 0 end) as [migrated] from posthistory where creationdate >= '1/1/2011' and creationdate < dateadd(week, datediff(week, 0, GetUtcDate()), -1) group by dateadd(week, datediff(week, 0, creationdate), 0) order by dateadd(week, datediff(week, 0, creationdate), 0)
Error: looks like you typed in the wrong words - try again