Announcements
 Crystal Reports Forum : General Information : Announcements
Message Icon Topic: Switch last name first name Post Reply Post New Topic
Author Message
jdubsky
Newbie
Newbie


Joined: 26 Sep 2011
Location: United States
Online Status: Offline
Posts: 1
Quote jdubsky Replybullet Topic: Switch last name first name
    Posted: 26 Sep 2011 at 9:18am
Master.name field contains names formatted with a / delimeter and the last name is first. I need to separate them,  then report with first name last name for output.
 
 
EG: Smith/John
       Smith/Mary
       Jones/Bill
 
needs to be converted to:
 John Smith
 Mary Smith
 Bill Jones
 
Sometimes the field only contains a first name and it usually a company name.  EG  123 contractor
or               AAA builder
 
These should remain the same.
 
 
Any help with the formulas would be appreciated. 
I tried using split but no getting any joy with that.
 
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3701
Quote hilfy Replybullet Posted: 30 Sep 2011 at 10:07am
Try something like this:
 
NumberVar slash;
slash := InStr({master.name}, '/');
if slash > 0 then
  mid({master.name}, slash + 1, length({master.name}) + ' ' + left({master.name}, slash - 1)
else
  {master.name}
 
-Dell
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.