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
 Development Tools
 Reporting Services Development
 Creating a combined IIF stmt (SQL 2000)

Author  Topic 

kathyc2003
Starting Member

15 Posts

Posted - 2008-02-07 : 18:07:20
Hello,

I have a field on my SRS Report called new_Region. I prompt the user to enter a value from 1-4. I need the new_Region field on my report to display the text below.

1 means "West"
2 means "Central"
3 means "East"
4 means "Atlantic"

So I tried creating this IIF statement, but I don't know
how to group it so that it works properly. Right now I'm
getting a #Error displaying in the field.

IIF (Fields!new_Region.Value=1, "West", "")
IIF (Fields!new_Region.Value=2, "Central", "")
IIF (Fields!new_Region.Value=3, "East", "")
IIF (Fields!new_Region.Value=4, "Atlantic", "")

Thanks

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-02-09 : 10:33:42
Use Switch function to achieve this. This function is available in expression window of reoporting services.

=Switch(Fields!new_Region.Value=1, "West",
Fields!new_Region.Value=2, "Central",
Fields!new_Region.Value=3, "East",
Fields!new_Region.Value=4, "Atlantic")
Go to Top of Page

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2008-02-09 : 12:26:05
You don't have a table that stores these values?

- Jeff
http://weblogs.sqlteam.com/JeffS
Go to Top of Page
   

- Advertisement -