I need to get a report that shows distinct users per week to show user growth per week, but I need it to show cumulative distinct users.

So if I have 5 weeks of data, I want to show:
Distinct users from week 0 through week 1
Distinct users from week 0 through week 2
Distinct users from week 0 through week 3
Distinct users from week 0 through week 4
Distinct users from week 0 through week 5

I have a whole year's worth of data. The only way I know how to do this is to literally query the time ranges adjusting a week out at a time and this is very tedious. I just can't figure out how I could query everything from week 0 through week 1 all the way to week 0 through week 52.

EDIT - What I have so far:

```
select count(distinct user_id) as count
from tracking
where datepart(wk,login_dt_tm) >= 0 and datepart(wk,login_dt_tm) <= 1

```

Then I take that number, record it, and update it to -- datepart(wk,login\_dt\_tm) <= 2. And so on until I have all the weeks. That way I can chart a nice growth chart by week.

This is tedious and there has to be another way.

UPDATE-
I used the solution provided by @siyual but updated it to use a table variable so I could get all the results in one output.

```
Declare @Week Int = 0
Declare @Totals Table
(
    WeekNum int,
    UserCount int
)
While @Week < 52
Begin
insert into @Totals (WeekNum,UserCount)
        select @Week,count(distinct user_id) as count
        from tracking
        where datepart(wk,login_dt_tm) >= @Week and datepart(wk,login_dt_tm) <= (@Week + 1)

    Set @Week += 1
End
Select * from @Totals

```