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.

 All Forums
 SQL Server 2005 Forums
 Analysis Server and Reporting Services (2005)
 Date grouping

Author  Topic 

mikebird
Aged Yak Warrior

529 Posts

Posted - 2009-03-02 : 05:29:56
When I have a matrix ruled by date, how do I group these in batches by day, week, month, etc?

I've never given it thought because Crystal Reports has an option by dropdown to do this. I assume the config has to be done by SQL clause. How do I group by 24-hours, 7 days, or 30 days, or 6 months, 1 or more years at a time?

mikebird
Aged Yak Warrior

529 Posts

Posted - 2009-03-02 : 05:35:21
Don't actually need to set parameters - the grouping will always be weekly. But how do you do it?
Go to Top of Page

mikebird
Aged Yak Warrior

529 Posts

Posted - 2009-03-02 : 06:18:40
What goes into the fx box in SSRS? I've tried concentrating on the entire SQL query / SP for the whole report, but from experience it's best to fetch all the columns with the right criteria, then leave levels of grouping, for charts and gauges til last with reports.
Go to Top of Page

mikebird
Aged Yak Warrior

529 Posts

Posted - 2009-03-02 : 06:28:24
Fixed. left(date, 11) in the SP does the job by getting rid of the time. 115,763 rows down to 2,658
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-03-02 : 12:57:57
quote:
Originally posted by mikebird

Fixed. left(date, 11) in the SP does the job by getting rid of the time. 115,763 rows down to 2,658


better tou use date functions like datepart(). using string functions like left() will cause problems in sorting the date values.
Go to Top of Page
   

- Advertisement -