IIF Expression - Overload resolution failed

I am getting an the error - "[BC30516] Overload resolution failed because no accessible 'IIf' accepts this number of arguments" when I execute the the below:

=iif(Lookup(Fields!OccurCode.Value,Fields!OccurCode.Value,Fields!OccurCode.Value,"TTDC_Papers") <> Fields!OccurCode.Value,"TTDC_Templates", False, True)

This to show/hide data based on the above statement. Any suggestions would be great.

1 answer

  • answered 2020-06-27 22:35 Alan Schofield

    IIF takes 3 parameters, but you are passing 4.

    You either have to remove the '"TTDC_Templates"' scope reference or, if you have to specify the scope, use an aggregate function on it with something like FIRST(Fields!OccurCode.Value, "TTDC_Templates")