seperate name by space

G

Guest

Hi,
I have a column with name like this: Jane Doe.
I would like to seperate this by space so that i'll have two columns: First
name: Jane and LastName: Doe. How would i do this in query??

Thank you!
 
G

Guest

Try this

Select Left(FieldName,Instr(FieldName," ") -1) As FirstName,
Mid(FieldName,Instr(FieldName," ") +1) As LastName From TableName
 
J

Joseph Meehan

GEORGIA said:
Hi,
I have a column with name like this: Jane Doe.
I would like to seperate this by space so that i'll have two columns:
First name: Jane and LastName: Doe. How would i do this in query??

Thank you!

More information please.

How is the name stored now (in the table)? Normally we recommend having
a First name field and a Last name field then you can put them together
easily or make two columns out of the data.

How consistent is the data? Do any names include middle initials etc?

Do you want to display the data this way or print it as in a report??
 
G

Guest

WORKS PERFECTLY!! Thank you!

Ofer said:
Try this

Select Left(FieldName,Instr(FieldName," ") -1) As FirstName,
Mid(FieldName,Instr(FieldName," ") +1) As LastName From TableName
 

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

merging rows 6
Use TextBox on the main form to limit SubForm 2
Separate Names 3
Combine data in two records from same field 16
Add Numbers To A Listbox 3
Query Filter 6
SUMIF & IF 5
Help with Logic!! 2

Top