Splitting Names

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi All,

I am trying to write a query that splits a person's name into first, middle
and lsat name. the data is currently stored in 1 field. does anybody have any
solutions on how this can be done.

Thanks
 
Hi,


Use InStr( ) to spot the delimiter (, or space) and Mid( ).

If there is just a space as delimiter, you can try:

FirstName: Split( YourString & " " ) (0)
MiddleName: Split( YourString & " " ) (1)
LastName: Split( YourString & " ") (2)



I added three spaces, to avoid errors (in case your string is NULL ).

Split may not work, in a query, for Access 2000, and does not exist, in
Access 97.


Hoping it may help,
Vanderghast, Access MVP
 
Blech, if you want a real name parser, send me an email at
(e-mail address removed).

David Atkins, MCP
 
Blech?

Blech, if you want a real name parser, send me an email at
(e-mail address removed).

David Atkins, MCP

Tom Ellison
Microsoft Access MVP
Ellison Enterprises - Your One Stop IT Experts
 
Do you truly believe his names *always* have three fields? Sure, they may,
but I've never seen a set of names that need splitting fall into pegs so
neatly that left(), mid(), and last() will work.

Unless, of course, this is just homework for school.

-- Grey

p.s. Check out my name parser, and you'll see what I mean.
 
Back
Top