Page 1 of 1

Name Seperation

Posted: Tue Oct 03, 2006 2:01 pm
by sdfasih
Hi,
Can somebody provide me code to seperate first name and middle initial.
Currently they are in the same field.Some examples are as follows

Cari A
Michael A C
Leslie Marc
Kuan-Yu
Cielo Patricia
Renee (Johnson) M
Gary D Sr
It should be like first name:cari
middle initial:A
First name:cielo
middle initial:p
Thanx in advance.

Posted: Tue Oct 03, 2006 2:05 pm
by kris007
What would be the Middle name in case of

Michael A C
Leslie Marc
Kuan-Yu
Renee (Johnson) M
Gary D Sr ?

What is the metadata of your Middle name. CHAR(1)? If you can play around with CAPITALS built in transform and the Field Function you might be get near to it.

Posted: Tue Oct 03, 2006 2:21 pm
by sdfasih
Kris
If the name is:Michael A C
Then first name will be Michael
Middle initials will be A C
if the name is :Leslie Marc
Then first name will be Leslie
Middle initials will be M.
Thanx

Posted: Tue Oct 03, 2006 4:54 pm
by ray.wurlod
Assuming that you want everything ahead of the first space character, and everything after the first space character, then the Field() function is what you need.

Code: Select all

Field(TheString, " ", 1, 1)
TrimF(Field(TheString, " ", 2, 99999))