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

separating first and last name delimitted by comma

Status
Not open for further replies.
May 16, 2003
7
US
How can I extract the first and Last names and copy them into there own fields.
i.e field1 Shmoe, Joe
becomes field1 joe
field2 Shmoe

thanks,

 
Calculation syntax for (to pull 'things' out of a field):

1. Title :
Case(Position("mr.mrs.miss.dr."; Left(Full Name; Position(Full Name; " "; 1; 1) -1); 1; 1);

Left(Full Name; Position(Full Name; " "; 1; 1) -1);

"")

2. for First Name :
Case(IsEmpty(Title); LeftWords(Full Name; 1); MiddleWords(Full Name; 2; 1))

3. for Suffix :
Case(Position("Jr.IIIVEsq.MDSr.PhD"; Right(Full Name; Length(Full Name) - Position(Full Name; " "; 1; PatternCount(Full Name; " "))); 1; 1);

Right(Full Name; Length(Full Name) - Position(Full Name; " "; 1; PatternCount(Full Name; " ")));

"")

4. for Last Name :
LeftWords(

RightWords(Full Name; Case(IsEmpty(Suffix);

1;

2));

1)

5. for Middle Name :
Case(MiddleWords(Full Name; Case(IsEmpty(Title); 2; 3); 1) = Last Name;

"";

MiddleWords(Full Name; Case(IsEmpty(Title); 2; 3); 1))

If you have all the fields (your field1 = Full Name), otherwise see what you can use...rest is for your calculation library :)

HTH

JW

 
...don't put them into 'their own field', those calculation can be useful to rectify data entry mistakes or to easy data entry...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top