New users per week


Please login or register to vote for this query.

(click on this box to dismiss)


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

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