Left-Right Functions?

D

dataH

Question for Access 2007

I have a field containing both numbers and text, separated by a common dash
(-):

Numbers Example: 57982-416; 241-45638; 113674588-1

Text Example: abcdefg-bbbk; jkte-ljpui

or both: 125879-asgtyu

I would like a way to separate the contents left of the dash in a new field
and the contents being the right of the dash into a separte field.


Thanks and Best regards

dataH
 
J

Jeff Boyce

Try a query.

Add a new field something like:

NewField: Left([YourField],Instr([YourField],"-")-1)

Add another new field like:

AnotherNewField: Mid([YourField],Instr([YourField],"-")+1)

Regards

Jeff Boyce
Microsoft Office/Access MVP
 

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