A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Update Query combine two functions



 
 
Thread Tools Display Modes
  #1  
Old July 18th, 2008, 06:22 AM posted to microsoft.public.access.queries
Darmahart
external usenet poster
 
Posts: 14
Default Update Query combine two functions

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
  #2  
Old July 18th, 2008, 06:42 AM posted to microsoft.public.access.queries
John W. Vinson/MVP
external usenet poster
 
Posts: 325
Default Update Query combine two functions

On Thu, 17 Jul 2008 22:22:01 -0700, Darmahart
wrote:

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], "(", "")
, ")", ""),
, "-", "")
, " ", "")

--

John W. Vinson/MVP
  #3  
Old July 18th, 2008, 06:54 AM posted to microsoft.public.access.queries
Darmahart
external usenet poster
 
Posts: 14
Default Update Query combine two functions

That did it - thanks so much!

"John W. Vinson/MVP" wrote:

On Thu, 17 Jul 2008 22:22:01 -0700, Darmahart
wrote:

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], "(", "")
, ")", ""),
, "-", "")
, " ", "")

--

John W. Vinson/MVP

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:37 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.