Extracting a last name from a field

  • Thread starter Thread starter Michelle
  • Start date Start date
M

Michelle

I inherited a database which has several hundred records.
It has a "Name" field with a person's title, first, and
last names separated by a space. Is there any way I can
extract just the last name from that field so that I can
sort the data by last name?
Thanks in advance.
 
This is a four step process.
1st: Title: Left([Name],InStr([Name]," ")-1)
LName: Mid([Name],InStr([Name]," ")+1)
First: Left([Lname],InStr([Lname]," ")-1)
Last: Mid([LName],InStr([LName]," ")+1)

Use the above within a query using the table that contains "Name".
 
Thanks. That worked!

-----Original Message-----
This is a four step process.
1st: Title: Left([Name],InStr([Name]," ")-1)
LName: Mid([Name],InStr([Name]," ")+1)
First: Left([Lname],InStr([Lname]," ")-1)
Last: Mid([LName],InStr([LName]," ")+1)

Use the above within a query using the table that contains "Name".

I inherited a database which has several hundred records.
It has a "Name" field with a person's title, first, and
last names separated by a space. Is there any way I can
extract just the last name from that field so that I can
sort the data by last name?
Thanks in advance.


.
 
If you run into trickier situations in the future, try using Splitter for Microsoft
Access. I have this add-in utility, and it does a wonderful job.

http://www.infoplan.com.au/splitter/

Tom
_________________________________________


Thanks. That worked!

_________________________________________



This is a four step process.
1st: Title: Left([Name],InStr([Name]," ")-1)
LName: Mid([Name],InStr([Name]," ")+1)
First: Left([Lname],InStr([Lname]," ")-1)
Last: Mid([LName],InStr([LName]," ")+1)

Use the above within a query using the table that
contains "Name".

_________________________________________

message
I inherited a database which has several hundred records. It has a "Name" field with a
person's title, first, and last names separated by a space. Is there any way I can
extract just the last name from that field so that I can sort the data by last name?

Thanks in advance.
 
Back
Top