How to separate Words by the spaces?

S

SinCity

In my table called "Table1" I have this....

Full_Name (column heading)
John Smith
Jack Spartin
Sue Whitman
Joe Garka

How can I separate it into mutliple columns like this...?
First_Name Last_Name
John Smith
Jack Spartin
Sue Whitman
Joe Garka

I figured I could probably do it by running a SQL Query, but I can't seem to
figure out how.
Am I on the right track?
 
V

Van T. Dinh

Provided that the names are consistent as your sample set, you can use a
Query with an SQL String like:

SELECT Left([Full_Name], InStr([Full_Name], " ") As First_Name,
Mid(([Full_Name], InStr([Full_Name], " ") + 1 ) As Last_Name
FROM [Table1]

The problem is that in real life, names are not consistent as your sample
set. Hence, the relational database theory state that data should be
atomic, i.e. each Field value should only contain ONE item of data. You
Field values contain 2 items of data each (in the context of your question!)
 

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