Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Andrzejek on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Last Name, Plus First Initial

Status
Not open for further replies.

jwrjwr54

Technical User
Apr 21, 2003
41
US
Morning

I'm using Crystal Reports XI.

Anyone have a good way to display an employee's last name, followed by a comma/space, and the first initial of their first name?

I've tried this formula, but it does not work:

if InStr({FE_ORG.MGR_NM}, ", ") =0 then
ProperCase(Left ({FE_ORG.MGR_NM},(instr(1,{FE_ORG.MGR_NM},",")+1))) else
ProperCase(Left ({FE_ORG.MGR_NM},(instr(1,{FE_ORG.MGR_NM},", ")+2)))

Thanks
 
try this in your formula.. I hope I got all my () correctly placed


localstringvar array x;
localstringvar LN;
localstringvar FI;
Localstringvar LNFI;

split({FE_ORG.MGR_NM});
LN := propercase(x[1]);
FI := uppercase(left(x[2],1));
LNFI := lastname & ", " & firstinitial;
LNFI


_____________________________________
Crystal Reports XI Developer Version
Intersystems Cache 5.X ODBC connection

 
correction!!!!!


localstringvar array x;
localstringvar LN;
localstringvar FI;
Localstringvar LNFI;

split({FE_ORG.MGR_NM});
LN := propercase(x[1]);
FI := uppercase(left(x[2],1));
LNFI := LN & ", " & FI;
LNFI

_____________________________________
Crystal Reports XI Developer Version
Intersystems Cache 5.X ODBC connection

 
the split command should read:

split({FE_ORG.MGR_NM},",");

I left out the delimiter....

_____________________________________
Crystal Reports XI Developer Version
Intersystems Cache 5.X ODBC connection

 
I think you should be showing samples of how your name field currently displays (before you apply any formulas).

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top