How to write multiple if statement in SSRS. I have written like this.
=IIf(Parameters!MyDuration.Value="ThisMonth" & Parameters!Transactions.Value="Sale", Sum(Fields!ThisMonthSal), True,False)
this is throwing an exception that multiple parameter used. Please guide me how to write this multiple if statement.
The
&operator concatenates two strings. You’re looking for theAndoperator. Refer to this msdn article.In addition, note that IIF has three parts (see decision functions here), and works like this:
I’m not sure what you’re trying to do with the “SUM” bit (or what you’re trying to achieve at all, the question’s not clear on that), but something like this would work:
Finally, you’re not entirely clear about the error you’re getting. If you’re also having a problem with accessing the parameter you may have to investigate that seperately. In any case, the above should explain the
Iifbit.