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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Format name/Nameswitch

Status
Not open for further replies.

SarahMS

Technical User
Sep 7, 2001
32
US
I have a name field that is formated like Smith, John D. Can someone tell me what the best way to reformat it to John D. Smith would be? I could drop back out to sql and do it, but if I can, I'd rather do it in crystal.

Crystal 8, sql 2000.
 
numbervar i:=instr({table.name},", ");

if i=0 then // no comma so can't split it
{table.name}
else
mid({table.name},i+2) & left({table.name),i-1)

I'm assumning that the format is always Surname, firstname
(i.e. there is a space after the comma that we don't want)
Editor and Publisher of Crystal Clear
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top