All, need a quick help on field function.
I have a name- ASHLEY, MARTHA ANNIE
This is char(30) column and need to separate it to first name,last name and middle name, three separate column. Used FIELD function below.
LAST NAME- FIELD(name,',','1')
Last name worked. But got stuck in first and middle name.
It should be,
Last name- ASHLEY
First Name-MARTHA
Middle name-ANNIE
Appreciate your help.
FIELD function
Moderators: chulett, rschirm, roy
So... the second comma delimited field is First and Middle. Pull that and then use Field again on that telling it is a space delimited string: 1=First and 2+=Middle. Now that won't always work but it should get you close enough so you can then identify the outliers.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
This is a case where I'd use stage variables to avoid unnecessary processing (in particular splitting the comma-delimited string more than once). For example:
Code: Select all
svFamilyName <-- Field(InLink.FullName, ",", 1, 1)
svGivenNames <-- Field(InLink.FullName, ",", 2, 1)
svFirstName <-- Field(svGivenNames, " ", 1, 1)
svMiddleName <-- Field(svGivenNames, " ", 2, 9)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: