Remover characters from text field MS Access

shieldsco
shieldsco used Ask the Experts™
on
I'm trying to remove the 1st 3 characters of a text field if the 3rd character is a dash (-) and the 1st 2 characters are numbers in an Access query or VBA. See attached sample result.


Image
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Analyst Assistant
Commented:
You could try this expression in a simple SELECT query,

ResultField: IIf(Val([CurrentField])=0,[CurrentField],Mid([CurrentField],InStr([CurrentField],"-")+1))

and if it gives the correct results change it to an UPDATE query with the expression in the Update To field against the existing field.

Author

Commented:
Thanks

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial