on 07-20-2016 3:41 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I might do something like this:
StringVar name := '';
NumberVar i
if not IsNull({field}) and {field} != "" then
if split({field}, ' ')[2] in ['JR', 'II', 'III'] then
(
for i := 3 to ubound(split({field}, ' ') Do
(
name := name + split({field}, ' ')[i] + ' ';
)
name := name + split({field}, ' ')[1] + ' ' + split({field}, ' ')[2];
)
else
(
for i := 2 to ubound(split({field}, ' ') Do
(
name := name + split({field}, ' ')[i] + ' ';
)
name := name + split({field}, ' ')[1];
)
)
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
25 | |
12 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.