1
votes

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 basically want to to remove every character that comes after the first white space

E.G if the value returned is Tom Ndovu, i want to Dispaly Tom.

if its Bill M Chark, i want to only display Bill.

1

1 Answers

4
votes

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)))