Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parsing Question 1

Status
Not open for further replies.

Bronte1226

Technical User
Oct 18, 2002
123
US
I am trying to create a query to parse out data in a field that has a format like this: 123-a-321

I have written this so far which gets me the last 3 numbers that I need, but still leaves the dash in place. I need to strip the dash as well, but can't seem to figure out how to do so in one step.

UPDATE April04_Tests SET April04_Tests.devid = Trim(right([devid],InStr([devid],"-")));

What am I missing?
 
Try this:
Mid([devid],InStrRev([devid],"-")+1)


Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top