Separate part of the same field

D

Dan

Hi all,
I have a access table and one column contains data for our partners like
"Name Surname (Town/Country)". I would like to sort them about Town and
Country, so I have to spare data from one column to another two like:
- first column Name Surname
- second Town
- third Country

After all I will use Excel and Data >- Filter >- Autofilter to sort out.

My question: how to spare data from one access (or excel) line to another 2
columns.

Thnx a lot.
 
G

Guest

Create three alias columns in the query.
Name: Left$([partner],InStr(1,[partner]," "))
Surname: mid$([partner]instr(1,[partner]," ")+1,InStrRev([partner],"
")-InStr(1,[partner]," ")-1)
TownCountry: Right$([partner],Len([partner])-InStrRev([partner]," "))

This example assumes that every record has three values, that no values have
spaces within them, and that your column is called [partner].

If you want to do this in Excel, try Text To Columns under the Data menu.

Barry
 
D

Dan

Hi,
I'm not so familiar with Access and these queries, but Excel command Text To
Columns is PERFECT for me! I'll export access queries to excel and use this
command.

Thnx you very much!



Barry Gilbert said:
Create three alias columns in the query.
Name: Left$([partner],InStr(1,[partner]," "))
Surname: mid$([partner]instr(1,[partner]," ")+1,InStrRev([partner],"
")-InStr(1,[partner]," ")-1)
TownCountry: Right$([partner],Len([partner])-InStrRev([partner]," "))

This example assumes that every record has three values, that no values
have
spaces within them, and that your column is called [partner].

If you want to do this in Excel, try Text To Columns under the Data menu.

Barry


Dan said:
Hi all,
I have a access table and one column contains data for our partners like
"Name Surname (Town/Country)". I would like to sort them about Town and
Country, so I have to spare data from one column to another two like:
- first column Name Surname
- second Town
- third Country

After all I will use Excel and Data >- Filter >- Autofilter to sort out.

My question: how to spare data from one access (or excel) line to another
2
columns.

Thnx a lot.
 

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