Extracting data to the right of a character

  • Thread starter Thread starter anthony
  • Start date Start date
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
 
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
..
 
Back
Top