Question : SSRS 2005 - Multiple IIF Statement

Hi
Using SQL Reporting Services 2005
I am attempting to create an expression that returns multiple values based on the value of a field. Thought this might work, but clearly not:

=IIF(0<(Fields!amount.Value, "CompanySales")<14999,"2.5%","0") OR
IIF(15000<(Fields!amount.Value, "CompanySales")<24999,"3%","0")OR
IIF(25000<(Fields!amount.Value, "CompanySales")<29999,"3.5%","0")OR
IIF(30000<(Fields!amount.Value, "CompanySales")<34999,"4%","0")OR
IIF(35000<(Fields!amount.Value, "CompanySales")<39999,"5%","0")OR
IIF(40000<(Fields!amount.Value, "CompanySales")<44999,"6%","0")

Any suggestions?

Answer : SSRS 2005 - Multiple IIF Statement

Try something like this, the Switch statement retruns the second of each pair based on the first one that evaluates to true.
1:
2:
3:
4:
5:
6:
7:
=SWITCH(Fields!amount.Value <=0,"0",
Fields!amount.Value <=14999,"2.5%",
Fields!amount.Value <=24999,"3%",
Fields!amount.Value <=29999,"3.5%",
Fields!amount.Value <=34999,"4%",
Fields!amount.Value <=39999,"5%",
Fields!amount.Value <=44999,"6%")
Random Solutions  
 
programming4us programming4us