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
0
Utf
5/6/2010 3:51:02 PM
access.queries 6343 articles. 1 followers. Follow

1 Replies
1348 Views

Similar Articles

[PageSpeed] 17

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]
0
Marshall
5/6/2010 5:00:48 PM
Reply:

Similar Artilces:

Replace word in sentence function...
I have the following function which replaces a word in a sentence with "....." =REPLACE(I2,SEARCH(E2,I2),LEN(E2),".....") Where the word is E2 and the sentence is I2. At the moment, if the word is "work" and the sentence is "I worked at home" I get the sentence "I .....ed at home". Any ideas how I could capture any remaining letters at the end of the word and get the result "I ..... at home"? I'd greatly appreciate your help. Thanks in advance, Chris can you upload example, would be easier to view -- Message posted from h...

find and replace hyperlink?
Hi, I want to globally find and replace the contents of a hyperlink with a new hyperlink. For example, I want this Jul.xls#'Title Page'!A1 to be replaced with Aug.xls#'Title Page'!A1 I can't seem to find a way do it. Is there a way? Thank you, Mike Take a look at David McRitchie's site: http://www.mvps.org/dmcritchie/excel/buildtoc.htm look for: Fix Hyperlinks (#FixHyperlinks) If you're new to macros, you may want to read David McRitchie's intro at: http://www.mvps.org/dmcritchie/excel/getstarted.htm me wrote: > > Hi, I want to g...

Search and replace problem
Hi, I have an Excel worksheets where in several cell's a symbol was added to mark the cell's "to review". The symbol used was "(*)". I have tried now to delete all the entries with a "search and replace", but Excel interpretes the asterisk as a DOS-symbol and deletes everythng between brackets. Is there a way to avoid that or to let Excel know that I only want to delete the specific characters. TIA Melissa It's because it is a wildcard, you can replace it by preceding it with a tilde ~ which tell Excel to find an asterisk in find what p...

Replacing Powerpoint 97 SR-2 on M/S Office 97 Pro Edit on Win XP
I dread asking this in case someone descends on me like a ton of bricks and says the answer is in the posts already! - but i I have never used the PP 97 which came with the MS Office 97 Pro Edit I have installed on my computer which uses Win XP with Ser Pack 3. I am about to embark on using PowerPoint for the FIRST time and wonder whether I should, before anything else, acquire a more up to date version first - and one that will work problem free with my XP - which version should I go for and will it, on loading, overwrite and replace the Powpoint I already have and still operat...

Exchange/Outlook archiving problem with space restrictions
I've recently read the following kb article that states archiving is broken when you've reached your space limit on an Exchange server. We are running Exchange Server 2003 SP2 and using Outlook 2003 clients. Does MS have any plans on fixing this issue? We have a lot of users hitting their limits and then not being able to archive items. http://support.microsoft.com/default.aspx?scid=kb;en-us;297226 ------------------------------ Jeff Wommer Sr. Systems Technologist Northern Michigan University On Wed, 02 Nov 2005 07:36:47 -0800, Jeff Wommer <jwommer@nmu.edu> wrote: >I&#...

replace a negative result with a zero?
I have my formula entered but need it to return a zero if the result is negative. Any help is greatly appreciated. -- Pam Well, what is the formula that you are using? You could try this: =3DMAX(your_formula,0) to replace your_formula. Hope this helps. Pete On Apr 19, 5:17=A0pm, Pam2277 <Pam2...@discussions.microsoft.com> wrote: > I have my formula entered but need it to return a zero if the result is > negative. =A0Any help is greatly appreciated. > -- > Pam Hi, =if(your formula<0,0,your formula) "Pam2277" wrote: > ...

Double spaced header?
Hi, I would like to know what controls the spacing when receiving a email from Outlook?. Example, my print out looks like this when being mailed from a certain program (database). From: Sent: Subject: Sensitivity: Now what causes the double spacing? I need the room to keep data on one page.. I have noticed that other emails when printed ot are single spaced...Could there be code from within the program delling outlook how to format itself, or does outlook do the formating, I'm inclined to believe that outlook does not double space by default.. Any help is appreciated. Bill -- ----...

Selective Replace in Search and Replace
I need to search and replace in a large document. I don't want to replace the entire search term/expression just part of it. In this case I am searching for a paragraph return followed by any letter (not digit) and then want to change that to paragraph/tab but keep the letter. The search looks like this ^p^$ but naturally if replace is ^p^t I lose the first letter of the text string which I don't want How can I construct either search and replace so that ^p Alexander turns into ^p ^tAlexander and not ^p ^tlexander Thanks in a...

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 Barbara wrote: >I have a text field with all values containing an aste...

I am having problems with line spacing in Publisher.
I am having a problem with Publisher 2003 and the spacing of the last lines of paragraphs. I am using a catalogue template to produce a "facebook" of people and information about them. At every last paragraph line, there is about 1/3 to 1/2 of an extra line's worth of space. The rest of the paragraph is fine; only the last line does this. I have tried, in the "Style and Formatting" box, checking the "Widow and Orphan Control" item, as well as the "Keep lines together" item. It doesn't seem to work. The style that I am using is "Accent ...

Replace more characters using replace
Hi I have number of characters in a string, that I like to replace with "nothing". I use a code like this: Sub test() Dim a As String a = "Jan+& Per" a = Replace(a, " ", "") a = Replace(a, "&", "") a = Replace(a, "+", "") MsgBox a End Sub As I have about 15 characters, that all should be replaced with nothing, I am looking ofr another way to it. Something like Sub test() Dim a As String a = "Jan+& Per" a = Replace(a, {" ",...

Do you want to replace the contents of
When my macro runs, it stops after this procdure and asks "Do you want to replace the contents ofthe destination cells" is there something I can add that will automatically tell it yes? Here is the part of the macro that it stops on. Selection.TextToColumns Destination:=Range("C1"), DataType:=xlDelimited, _ TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=False, _ Semicolon:=False, Comma:=False, Space:=False, Other:=True, OtherChar _ :="/", FieldInfo:=Array(Array(1, 1), Array(2, 1), Array(3, 1)) Thanks H...

Filter Data using wildcards
I'm trying to filter some data in Excel 97 to only view rows where the description starts with two question marks (eg. ??item1, ??item2 etc). I set up a custom filter with the drop down box set to 'begins with' and the value set to ?? (see attached file) but excel treats question marks as wildcards and thinks the question marks represent any single character. Any idea how to force it to recognise wildcards as actual characters? I presume the same problem occurs if trying to search using the asterisk symbol. Thanks Al File Attached: http://www.exceltip.com/forum/attachment.php...

Replacing old Windows XP and Outlook Express with new Windows 7
How do I export the contents and settings out of Outlook Express and import the accounts, settings and emails into Windows Live Mail on another machine? For messages: Copy the *ENTIRE* OE message store folder to flash or CD. (Folders.dbx must be included). Place this on the Desktop or other location on the machine using WLMail. Open WLMail and: File | Import | Messages | Microsoft Outlook Express 6 and point to where you saved it. For Addresses: Open the Address Book in OE and File | Export | Address Book (wab) and save it to the Desktop. Copy to flash or CD. Place this on the...

How do I replace just a few characters?
Hello, I have an excel worksheet with a street name column. I need to rename some names from "Main Street" to "Main St". I can do it for one name easily with find and replace, but how do I make it work for an entire column of different names such as "Easy Street" and "Main Street". If I do find "* Street" and replace with "* ST" I get "* ST" for the output instead of "Easy ST" What am I missing? -- Tomsriv ------------------------------------------------------------------------ Tomsriv's Profile: http:/...

VBA to find filename and replace
Hi I just found the answer to "Find and Replace in VBA" and tried to adapt it for what I'm doing, but it's more difficult so I need some help please. I have multiple worksheets in an excel 2007 workbook - a monthly report. Within the worksheets I have many cells that link to last months workbooks - (i.e I compare last month figures to this months figures). I need the macro to do the following: - Create an Input box for the user to "enter the name ofTHE OLD months workbook" - Create an Input box for the user to "enter the name of THE NEW mont...

Replacing Character
I need to replace/delete the " >" character at the end of a number... when the data was brought into the excel 1234> was the number that cam it happens in about 7000 lines any suggestions on how to replace it with a blank?? thank -- tico31p ----------------------------------------------------------------------- tico31pl's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=1040 View this thread: http://www.excelforum.com/showthread.php?threadid=46572 Select the range to fix. Edit|Replace what: " >" (without the quotes with: (leav...

Remove blank spaces in an address
Hi there, is there a way to delete a blank spaces from an address i.e. 124 High Street would then be 124HighStreet I've played around with LEFT and RIGHT functions and & " " but can't quite get it. Any help would be appreciated. Try SUBSTITUTE: =SUBSTITUTE(A1," ","") HTH Jason Atlanta, GA >-----Original Message----- >Hi there, > >is there a way to delete a blank spaces from an address > >i.e. 124 High Street > >would then be 124HighStreet > >I've played around with LEFT and RIGHT functions and & ...

Replacing A Column Of Numbers
Hello, New user of Excel 2007, and Excel in general. Should be simple, but I just can't figure out how. Have a column of numbers in Column A In Column B (row 1)I have the formula of what's in A (row 1) multiplied by 1000 And I have dragged this formula downwards, so I now have in each row B what is in the same row in Column A multiplied by 1000. So far, all is fine. Now, I want to replace what's in Column A by the newly generated values in Column B (row by row replacement) I can't just Cut out everything in Column A, as B then disappears, as, I'v...

Find / Replace
In a field, I would like to update all instances of "Daily Billing" to "Rental Payment - Daily Billing". The Replace function works the first time, but when I add data to the file, and run the query again, it updates the fields which have already been upated to "Rental Payment - Rental Payment - Daily Billing". I can see why it is doing this, but is there a way for the update query to look at just the first 11 characters of the field and only perform the update if it finds the "Daily Billing" text there? Thanks. Use "Daily Billing" as ...

Replacing an OLE picture's picture property
I've been designing a catalog for my home movies. When the user uses a dropdown down menu, selects the title, it reads a synopsis and image name to display for that movie. Its an OLE picture object , but each time a new movie is selected, the code inserts another image (doesn't replace the existing image). My problem is that I can't figure out how to access the .picture property of the OLE object. ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~View and post usenet messages directly from http://www.ExcelForum.com/ ~~Now Availab...

using smart replace with replace
Hello there when u run replace(Field, 'abc', 'def') it replace any text in field who have 'abc' no metter what is before and after the text But if i want to replace 'abc[', 'abc', 'abc def', 'abc def', 'abc.def' ext.... and not replace 'abcd', 'abc_def' is there a way to do this? Is that what you are looking for? UPDATE my_table SET my_column = REPLACE(my_column, 'abc', 'def') WHERE my_column IS NOT LIKE '%abcd%' AND my_column IS NOT LIKE '%abc_def%' ...

Replace zeros with "-" in Reports
Hello Experts, I have a report that based on a query. The query adds up my monthly hours for the people that work on the project and the report displays the result. my formula in the query to calculate total forJanuary for example is 07Jan: Nz([07Jan_1])+Nz([07Jan_2])+Nz([07Jan_3])+Nz([07Jan_4]). So all I do is add the field 07Jan into my report. The problem am having is I like to replace all the 0.00 totals with "-". I try to do IIF(Nz([07Jan]=0,"-",Nz([07Jan]) but I get an #Error in the repot. The only way I got to work is by using a text box and if I repeat th...

replacing with placeholder
Hi @all I would like to use a general placeholder to replace cellvalues. example: All my Phonenumers end with a '-'. Now I would like to replace the '-' with just nothing. This is easy with replace '-' with ''. Unfortunately the '-' character is also used inside the number (+34-2344234-). How can I do this now? I would tried to replace '*-' with '*' -> results is just '*' (makes sense...) anybody an idea? thnx in advance Daniel P.S. in a DosBox you can do this with: rename *.htm *.html (renames all .htm file to .html files ...

Keyboard Shortcut to toggle b/w Find and Replace and Active Worksheet?
Hi: I open the Find and replace Dialogue Box using CTRL+F and then enter the value I am looking for. Excel moves the cursor to the cell in question with the found value. Is there anyway to then use the keyboard to move from the dialogue box into the actual worksheet, without having to mouse click back into the open file? It seems there has to be some type of way to use the keyboard to move from the Find Dialogue box without using the mouse. I hope I am being clear on what I am trying to do, it seems very simple yet I cannot figure out what keyboard command to use to basically select the Exce...