New users per week

0

Please login or register to vote for this query.

(click on this box to dismiss)

Politics

Q&A for people interested in governments, policies, and political processes

DECLARE @FirstQuestion datetime = (SELECT CreationDate FROM dbo.Posts WHERE Id = 1) + 1;
DECLARE @LastQuestion datetime = (SELECT MAX(CreationDate) FROM dbo.Posts WHERE PostTypeId = 1);


select CAST(DATEADD(week, DATEDIFF(week, @LastQuestion, CreationDate), @LastQuestion) AS Date) Week,
       count(*) new_users
from Users
group by DATEDIFF(week, @LastQuestion, CreationDate)
order by DATEDIFF(week, @LastQuestion, CreationDate)

Enter Parameters

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