Extracting data to the right of a character

A

anthony

I need to extract data to the right of a dash (-). For example, from
123-34, I need 34 The data can be of a variable length with no set
length either before or after the dash so I can't use Right or Left
functions. I can't immediately see a built-in function that would do
this. Do I have to grow my own? Anyone already done it?

TVM

Anthony
 
J

John Spencer

You need to use the Instr function to locate the dash and then get
everything from there on.

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

Actually if YourField could be Null, you might want to force the Instr
comparison to check a string. Null value will cause an error for the Instr
function

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

--
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 

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