select DATEADD(wk, DATEDIFF(wk,0,creationdate), 0) [weeks...

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(wk, DATEDIFF(wk,0,creationdate), 0) [weeks]
     , count(*)  [questions per day]
from posts
where posttypeid = 1 -- Q
and creationdate < DATEADD(wk, DATEDIFF(wk,-1,(select max(creationdate) from posts where posttypeid = 1)), -1)
group by DATEADD(wk, DATEDIFF(wk,0,creationdate), 0)
order by DATEADD(wk, DATEDIFF(wk,0,creationdate), 0)

Enter Parameters

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