finding values in a string

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

i am trying to develop a query to find numeric values that are preceded by X,
ie, i'd like to return 633 from this: 123456x633. the X and the desired
value should appear in the 7th to 10th positions, but due to inputting error,
some appear in the 6th to 9th positions or elsewhere. is there a way i can
"find" the X and then return the 3-digit value that follows it?

thanks!
 
SELECT MID( fieldName & "X", 1+ InStr( fieldName & "X", "X") , 3)
FROM tableName

return the 3 characters following the first X.


Hoping it may help,
Vanderghast, 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

Back
Top