Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Can someone help? I am creating a chart in ssrs that shows number of new subscriber for every 5 days. I need to figure out how to group those subscriber with rolling 5 day. I do not need help with chart just the best way to get the grouping. I have the parameters set with start and end dates. Thanks!
visakh16
Very Important crosS Applying yaK Herder
52326 Posts
Posted - 2012-05-24 : 15:08:07
does rolling period has to be based on input parameter values?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/
Cat7
Starting Member
2 Posts
Posted - 2012-05-24 : 20:40:49
quote:Originally posted by visakh16 does rolling period has to be based on input parameter values?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/
yes, it does
visakh16
Very Important crosS Applying yaK Herder
52326 Posts
Posted - 2012-05-25 : 09:54:49
something like
SELECT DATEDIFF(dd,Datefield,@EndDate)/5,COUNT(SubscriberID) AS CntFROM Table WHERE Datefield >=@StartDateAND DateField < @EndDate + 1GROUP BY DATEDIFF(dd,Datefield,@EndDate)/5
------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/