Update Query combine two functions

D

Darmahart

Is there a way to combine two functions in the Update To box for one field?
I'm trying to use Replace() to get rid of two excess strings of duplicate
letters. If there is another function(I can't use code) that can get rid of a
string of 3 of the same consecutive letters that would also work.

Thanks in advance
 
J

John W. Vinson/MVP

Is there a way to combine two functions in the Update To box for one field?
I'm trying to use Replace() to get rid of two excess strings of duplicate
letters. If there is another function(I can't use code) that can get rid of a
string of 3 of the same consecutive letters that would also work.

Thanks in advance

You can pass a function call as an argument to a function call. for
instance, to use Replace to remove parentheses, hyphens and blanks
from a phone number - to turn (800) 555-5555 into 8005555555 - you can
use Replace(Replace(Replace(Replace([Phone], "(", ""), ")", ""), "-",
""), " ", "")

or, more readably,

Replace(
Replace(
Replace(
Replace(
[Phone], "(", "")
, ")", ""),
, "-", "")
, " ", "")
 
D

Darmahart

That did it - thanks so much!

John W. Vinson/MVP said:
Is there a way to combine two functions in the Update To box for one field?
I'm trying to use Replace() to get rid of two excess strings of duplicate
letters. If there is another function(I can't use code) that can get rid of a
string of 3 of the same consecutive letters that would also work.

Thanks in advance

You can pass a function call as an argument to a function call. for
instance, to use Replace to remove parentheses, hyphens and blanks
from a phone number - to turn (800) 555-5555 into 8005555555 - you can
use Replace(Replace(Replace(Replace([Phone], "(", ""), ")", ""), "-",
""), " ", "")

or, more readably,

Replace(
Replace(
Replace(
Replace(
[Phone], "(", "")
, ")", ""),
, "-", "")
, " ", "")
 

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