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  

Replace wildcards with a space



 
 
Thread Tools Display Modes
  #1  
Old May 6th, 2010, 04:51 PM posted to microsoft.public.access.queries
Barbara
external usenet poster
 
Posts: 306
Default Replace wildcards with a space

I have a text field with all values containing an asterisk. The asterisk can
be located anywhere within the contents. I am trying to replace the asterisk
with a space. I will then use TRIM to remove any spaces at the beginning of
the text.

I have been unable to get an update query to work. When my criteria is like
"~[*}", Access says that 0 rows will be updated. When the criteria is[*],
I am asked to enter a parameter value.

Any assistance will be greatly appreciated.

Thanks - bkh
  #2  
Old May 6th, 2010, 06:00 PM posted to microsoft.public.access.queries
Marshall Barton
external usenet poster
 
Posts: 5,361
Default Replace wildcards with a space

Barbara wrote:

I have a text field with all values containing an asterisk. The asterisk can
be located anywhere within the contents. I am trying to replace the asterisk
with a space. I will then use TRIM to remove any spaces at the beginning of
the text.

I have been unable to get an update query to work. When my criteria is like
"~[*}", Access says that 0 rows will be updated. When the criteria is[*],
I am asked to enter a parameter value.


UPDATE table
SET field = Trim(Replace(field, "*", " "))
WHERE field Like "*[*]*"

--
Marsh
MVP [MS Access]
 




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 01:31 PM.


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