 Former Member

# Change display order of name data

We have most of the names in particular column are backwards, here you have last_name, First_name, and middle initial.

DOOLEN JOHN W. We prefer to display rather as John W. Doolen (First, mid, last)

Howeve, what to do with some which has the JR. IN that case, the JR is currently second place, sb 4rth place.

DOOLEN JR JOHN W

10|10000 characters needed characters exceeded

### Related questions

• Posted on Jul 20, 2016 at 03:00 PM

I might do something like this:

StringVar name := '';

NumberVar i

if not IsNull({field}) and {field} != "" then

if split({field}, ' ') in ['JR', 'II', 'III'] then

(

for i := 3 to ubound(split({field}, ' ') Do

(

name := name + split({field}, ' ')[i] + ' ';

)

name := name + split({field}, ' ') + ' ' + split({field}, ' ');

)

else

(

for i := 2 to ubound(split({field}, ' ') Do

(

name := name + split({field}, ' ')[i] + ' ';

)

name := name + split({field}, ' ');

)

)

name

This will produce the name in all caps, so you'll also have to change the string to mixed/title case to get the output you're looking for.

-Dell

10|10000 characters needed characters exceeded
• Posted on Jul 21, 2016 at 06:48 AM

Hi Paul,

Dell suggested formula is good, in case if you find it difficult try below :

Numbervar i:=ubound(split({@field},' '));

stringvar n:='';

if ubound(split({@field},' '))=4 Then

n:= split({@field})[i-1]+' '+split({@field})[i]+' '+split({@field})[i-2]+' '+split({@field})[i-3]

Else

n:=split({@field})[i-1]+' '+split({@field})[i]+' '+split({@field})[i-2];

Note : replace {@field} with your database field.

Thanks,

Sastry