Code:
=IIF(Fields!tipo.Value=0, MonthName(right(Fields!mensalidadeId.Value,2)) & " " & int(left(Fields!mensalidadeId.Value,4)),int(left(Fields!mensalidadeId.Value,4)))
I have this condition in a textbox inside the report
- Fields!tipo.Value can assume 4 values: 0, 1, 2, 3
- Fields!mensalidadeId.Value (this is year, or year and month concateneted) can assume values like 2012, 2013, 201212, 201301
- When Fields!tipo.Value<>0 then Fields!mensalidadeId.Value is always 2012 or 2013
The problem is that when Fields!tipo.Value<>0 and Fields!mensalidadeId.Value=2013 the result of the condition is an error (trying to calculate MonthName(13)).
I assume even if the condition is false (ie Fields!tipo.Value<>0) IIF evaluates all arguments...
Thx in advance...
Regards