splitting a field

T

tgl

I have a database including full name:
prefix firstname middlename lastname

some fields have a prefix and/or middlename some do not.
How can i pull out just lastname

i assume it's some variation on right() and instr() but can't seem to do it.
 
S

Steve Schapel

Tgl,

Mid([Full Name],InStrRev([Full Name]," ")+1)

(assumes the LastName does not contain a space, i.e. this will not work
for Joe Di Maggio)
 
T

tgl

Thanks! so easy when you know how!!
tgl

Steve Schapel said:
Tgl,

Mid([Full Name],InStrRev([Full Name]," ")+1)

(assumes the LastName does not contain a space, i.e. this will not work
for Joe Di Maggio)

--
Steve Schapel, Microsoft Access MVP
I have a database including full name:
prefix firstname middlename lastname

some fields have a prefix and/or middlename some do not.
How can i pull out just lastname

i assume it's some variation on right() and instr() but can't seem to do it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top