Skip to content Skip to sidebar Skip to footer

Remove All Characters After First White Space In Ssrs 2005

in an SSRS report textbox, i have this =Fields!FullName.Value which displays a customers Full name (FirstName and LastName). What i want to do is to only display their FirstName. I

Solution 1:

This instruction get the string from the start to the first occurence the character " " (space)

=Mid(Fields!FullName.Value,1, Instr(Fields!FullName.Value, " "))

If the white space is not always present you should check the value returned from Instr using something like this

=Mid(Fields!FullName.Value ,1,
IIF(Instr(Fields!FullName.Value, " ") > 0 ,Instr(Fields!FullName.Value, " "),
LEN(Fields!FullName.Value)))

Post a Comment for "Remove All Characters After First White Space In Ssrs 2005"