=mid(Fields!Description.Value,0,instr(Fields!Description.Value,"-")+1)
Left
Mid
=Left(Fields!Description.Value, InStr(Fields!Description.Value, "-")-1)
Richard Deeming wrote (in the comment):The IIF function evaluates both branches in all cases, which is why you're getting an error. You'll need to use IIF in a slightly different position: =Left(Fields!Description.Value, IIF(InStr(Fields!Description.Value, "-") > 0, InStr(Fields!Description.Value, "-") - 1, Len(Fields!Description.Value)))
IIF
=Left(Fields!Description.Value, IIF(InStr(Fields!Description.Value, "-") > 0, InStr(Fields!Description.Value, "-") - 1, Len(Fields!Description.Value)))
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)