Type mismatch when trying to split names

D

Dave

I found the code and tried using it to split a first name and last name. I
am using this is a select query.

Can someone get me started?

[mgr] is text

Thanks


Ex: John Smith FName = John LName = Smith

FName: Left([mgr],InStr([mgr]," ")-1)
LName: Right([mgr],InStr([mgr]," ")+1)
 
T

Tom Ellison

Dear Dave:

I recommend one change:

LName: Mid([mgr],InStr([mgr]," ")+1)

Also, if anyone ever enters a name with no space in it, you've got a
problem there, too.

Tom Ellison
Microsoft Access MVP
Ellison Enterprises - Your One Stop IT Experts
 

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

Similar Threads


Top