By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,327 Members | 1,797 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,327 IT Pros & Developers. It's quick & easy.

split field name into two

P: 6
I have table, ex Servicenumber, Serviceplace and ContactPerson.
I want to split Contactperson into Firstname and LastName. They are seperated by space in ContactPerson field.

can somebody help me?
Nov 27 '06 #1
Share this Question
Share on Google+
5 Replies

P: 11
I'm sure one of the guru's in here can help you do this with MS Access, however one solution would be to export or cut and paste that field's data into a text file then import it into excel as a space deliminated file.

That means it will interpret any spaces as a tab and break up the first and last names into seperate colums. Then you could import that back into your database (or cut and paste it back).

Nov 27 '06 #2

Expert 2.5K+
P: 3,072
You can add the two needed fields to the table and use a query like:

update tblNames set FirstName = left(fullname,instr(fullname," ")-1), LastName = Mid(fullname,instr(fullname," ")+1);

Now the fields will be filled and the fullname field can be removed, but remember that not all names have two parts...

Nov 27 '06 #3

Expert 100+
P: 1,418
If you want to create a special function....

See how you can use the function split(expression, delimiter)

It isn't for direct use directly from query, coz it returns an array...

But if u create your own function that gets an entry from the array this can be done!
Nov 27 '06 #4

P: 6
Thank you everyone :)
With help from you all I managed it.

But i canīt make any change in the tables yet.(big system).
One time I have to rebuild it all ;P It so fucked up system.
Nov 27 '06 #5

Expert Mod 15k+
P: 31,661
Don't forget to make a back-up copy of your database before making any fundamental changes like this.
Good luck.
Nov 27 '06 #6

Post your reply

Sign in to post your reply or Sign up for a free account.