Any ideas why this returns an error?
=Iif(Len(Fields!FailedOn.Value) > 0,Left(Fields!FailedOn.Value,Len(Fields!FailedOn.Value)-1),"")
Basically, FailedOn is a string of which questions a candidate failed on, separated by a comma. I can end up with the string Q1,Q3,Q4, - I want to remove the trailing comma, which is why I'm taking the length of the string and subtracting 1, as there is always a trailing comma. For any values of FailedOn where the length is not greater than 0, it returns #Error.
If I remove the Left(...) function and replace the true and false values with static values like "Yes" and "No", values of FailedOn where the length is not greater than 0 correctly return "No". I'm not sure why this happens though, as the Left function is in the true section of the Iif statement and values of FailedOn where the length is not greater than 0 should bypass the true part.
Any ideas? This is VB by the way.
=Iif(Len(Fields!FailedOn.Value) > 0,Left(Fields!FailedOn.Value,Len(Fields!FailedOn.Value)-1),"")
Basically, FailedOn is a string of which questions a candidate failed on, separated by a comma. I can end up with the string Q1,Q3,Q4, - I want to remove the trailing comma, which is why I'm taking the length of the string and subtracting 1, as there is always a trailing comma. For any values of FailedOn where the length is not greater than 0, it returns #Error.
If I remove the Left(...) function and replace the true and false values with static values like "Yes" and "No", values of FailedOn where the length is not greater than 0 correctly return "No". I'm not sure why this happens though, as the Left function is in the true section of the Iif statement and values of FailedOn where the length is not greater than 0 should bypass the true part.
Any ideas? This is VB by the way.