How Replace a String of Text within another String of Text, exampl

W

wadev1

I am trying to figure out how to replace a text string within another set of
text. The string could appear multiple times in the field (ex. 123 FM1960
South). I would like to remove all spaces in the example. I have created a
update query that will replace the values by using Instr, Mid, etc. However,
I would have to be able to run the update query multiple times to achieve
the desired affect. My question would be, does any one know how to run a
Update Query multiple times, (a loop)? If so, do you an example of some code
I could view? Or, some code that would achieve the same end result.
 
R

Ron Weiner

You can do it all in one pass using the Replace() function. Here is an
Example:

Update tblYourTable Set TextField = Replace([TextField]," ","")

This will replace all of the spaces with "" (an empty string).

Ron W
 

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