seperate name by space

  • Thread starter Thread starter Guest
  • Start date Start date
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!
 
Try this

Select Left(FieldName,Instr(FieldName," ") -1) As FirstName,
Mid(FieldName,Instr(FieldName," ") +1) As LastName From TableName
 
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??
 
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


Back
Top