W
william
Hello,
I've imported an excel spreadsheet with a Name column which is
formatted as Last, First, MI. Some examples I have in the Name column:
Smith, Ellen P.
Jones, Mary Jane
Blackman-Pearson, Betsy D.
Wright, George
I need to parse it out so I have two columns, LastName and FirstName
with No Middle initial and No Middle Name. It's ok for hyphenated last
names to remain so.
I've successfully parsed the last name in a query with the following
statement:
Last: Left([Name],InStr([Name],",")-1) which produced the following:
Smith
Jones
Blackman-Pearson
Wright
So far so good.
I've parsed out everything following the comma to begin my attempt at
just grabbing the first name. I've used the following code:
First: Trim(Mid([Name],InStr([Name],",")+1)) which produced the
following:
Ellen P.
Mary Jane
Betsy D.
George
As you can see, it only works when there is one first name with no
initial. I'm stuck on how to parse out just the first name with
nothing else. This is what I evenutally want to see:
Ellen
Mary
Betsy
George
Any help is greatly appreciated.
Thanks
WPW
I've imported an excel spreadsheet with a Name column which is
formatted as Last, First, MI. Some examples I have in the Name column:
Smith, Ellen P.
Jones, Mary Jane
Blackman-Pearson, Betsy D.
Wright, George
I need to parse it out so I have two columns, LastName and FirstName
with No Middle initial and No Middle Name. It's ok for hyphenated last
names to remain so.
I've successfully parsed the last name in a query with the following
statement:
Last: Left([Name],InStr([Name],",")-1) which produced the following:
Smith
Jones
Blackman-Pearson
Wright
So far so good.
I've parsed out everything following the comma to begin my attempt at
just grabbing the first name. I've used the following code:
First: Trim(Mid([Name],InStr([Name],",")+1)) which produced the
following:
Ellen P.
Mary Jane
Betsy D.
George
As you can see, it only works when there is one first name with no
initial. I'm stuck on how to parse out just the first name with
nothing else. This is what I evenutally want to see:
Ellen
Mary
Betsy
George
Any help is greatly appreciated.
Thanks
WPW