Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select
- datepart(wk,Subscription_Date) as WeekNo,
- sum(case when Subscription_Type = 1 then 1 else 0 end) as TotalSubcriptions
- from tbSubscriptions
- group by datepart(wk,Subscription_Date)
- order by 1
- WeekNo |Total Subscriptions
- 21 |12
- 22 |13
- 23 |8
- 24 |18
- WeekNo |CumulativeSubscriptions
- 21 |12
- 22 |25 (=12+13)
- 23 |33 (=25+8)
- 24 |51 (=33+18)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement