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)
 Create several groups based on an existing express

Author  Topic 

phoeneous
Starting Member

9 Posts

Posted - 2009-10-12 : 14:40:58
I'm fairly new to SSRS and I'm trying to create groups based on an existing expression...or an easier method.

Scenario: I have a field named Date and it is in the format of MM/DD/YYYY. Then I have another field Days_until_Date which uses the expression =DateDiff(dateinterval.day, now, Fields!Date.Value ). What I would like to do is create 5 groups based on the Days_until_date value. Group 1 would be values between 45 and 90, group 2 would be values between 91 and 120, and so on up to 365. Is this possible? Any help is appreciated.

JCirocco
Constraint Violating Yak Guru

392 Posts

Posted - 2009-10-13 : 08:56:48
This is a function of your SQL statement and not SSRS.

You can use a CASE statement to do the grouping

case
when Days_until_Date >=45 and Days_until_Date <=90 then Create_Group1_Field_Here
when Days_until_Date >=91 and Days_until_Date <=120 then Create_Group2_Field_Here
when Days_until_Date >=121 and Days_until_Date <=365 then Create_Group3_Field_Here
end


John
Go to Top of Page
   

- Advertisement -