Replace Multiple Substrings

P

Phish76

Hi

I have fields containing "Personal Reference 123456/PC". I need to only
keep the number and get rid of Personal Reference an /PC.

I can use the replace function in an expression to get rid of /PC but don't
know how to add the other substring of Personal Reference.

My expression so far is Expr1: Replace(([field1],"/PC","")

Thanks in advance!

Lisa
 
J

John Spencer

If the string is always "Personal Reference" then you could nest two replace
functions.

Replace(Replace(Field1,"Personal Reference ",""),"/PC","")

Or you could use the Mid function and the replace function.
Replace(MID([Field1,20),"/PC")

John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
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