Crystal - Name display

have field that displays name as {lastname}, {firstname} {initial}

how can I get to display as firstname lastname

example
Major, Jerome W.

Result:  
Jerome Major
kelsanitAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mlmccCommented:
Are they 3  separate database fields?

If so
Create a textbox in the report
Drag the first name field to the box
Type a space
Drag the last name field to the box

If you want you can create a formula
{firstname} + ' ' + {lastname}

mlmcc
0
kelsanitAuthor Commented:
no it is all in one field called name
0
mlmccCommented:
Does it always have that format?

If so try this formula

Local StringVar Array strNames;
Local StringVar LastName;
Local StringVar FirstName;

Names := Split({Name}, ',');

LastName := strNames[1];
FirstName := Split(Trim(strNames[2], ' ');

FIrstName + ' ' + LastName

Open in new window


mlmcc
0
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

kelsanitAuthor Commented:
yes, always in same format.

Tried formula but getting error saying "remaining text does not appear part of the formula after the "local stringvar Firstname;

Local StringVar Array strNames;
Local StringVar LastName;
Local StringVar FirstName;
Names:= Split({EmployeeHours.Name}, ',');
LastName:= strNames[1];
FirstName:= Split(Trim(strNames[2], ' ');
FIrstName + '
0
mlmccCommented:
Assuming you copied it I see 2 issues
Names on that line should be strNames
The assignment to FirstName was missing a ) at the end

Local StringVar Array strNames;
 Local StringVar LastName;
 Local StringVar FirstName;
 strNames:= Split({EmployeeHours.Name}, ',');
 LastName:= strNames[1];
 FirstName:= Split(Trim(strNames[2], ' '));
 FIrstName + ' ' + LastName
 

Open in new window


mlmcc
0
kelsanitAuthor Commented:
now getting "to many arguments have been given to this function" for the FirstName:= Split(Trim(strNames[2], ' '));
0
mlmccCommented:
I put the ) in the wrong place

FirstName:= Split(Trim(strNames[2]), ' ');

mlmcc
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
James0628Commented:
I think that should that be

FirstName:= Split(Trim(strNames[2]), ' ') [ 1 ];


 Also, just to throw this out there, if the names could include something like ", Jr." after the last name (eg. "Major, Jr., Jerome W."), the formula won't handle those (you'd get "Jr. Major").  I don't know if there's a good way to handle that.

 James
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Crystal Reports

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.