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!

Parsing a String Name Field 1

Status
Not open for further replies.

SR24

Programmer
Jan 14, 2005
19
US
I am looking for some help in parsing a string field which contains data as follows:

LName, FName MName

I need to show the Last, First and Middle Initial in seperate fields. I successfully use the Split function to parse the LName and FName into separate fields but I am having trouble parsing the MName. The Split function apparently does not work for this because not all records show a middle initial. Any idea how I can parse the MName if a record contains one?

Thanks!
 
You could use the following:

//{@LastName}:
split({table.string},", ")[1]

//{@FirstName}:
split({table.string}," ")[2]

//{@MiddleName}:
if ubound(split({table.string}," ")) > 2 then
split({table.string}," ")[3]

-LB
 
Thanks LB! Formula 3 works great. I had found a work around to parse Middle Name but this works much better. I found a few records that show the full middle name in the @MiddleName field. Since I can only populate 1 character in this field I modified the formula as follows:

if ubound(split({table.string}," ")) > 2 then
Left(split(table.string," ")[3],1)

Thanks a million!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top