Is there a "text to column" equivalent in Access

E

E-man

In Excel you can use the "text to column" to split cells across columns.
How do you do this in Access?
I have fields with a format of xxxx-xxx and want to split these into 2
fields minus the -.
 
J

John Vinson

In Excel you can use the "text to column" to split cells across columns.
How do you do this in Access?
I have fields with a format of xxxx-xxx and want to split these into 2
fields minus the -.

Not builtin, but an Update query will do this. Add the two fields to
your table, and create an Update query. Update the field for the left
portion to

Left([fieldname], InStr([fieldname], "-") - 1)

and the other portion to

Mid([fieldname], InStr([fieldname], "-") + 1)

John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 

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