I have *** strings, how to replace them

  • Thread starter Thread starter Georgee
  • Start date Start date
G

Georgee

My data contains strings of three asterisks followed by few spaces, I
need to replace the them with different string. How to input them into
query so they are not considered "wildcards?" I tried [***] or
[*][*][*], it did not work.

George
 
My data contains strings of three asterisks followed by few spaces, I
need to replace the them with different string. How to input them into
query so they are not considered "wildcards?" I tried [***] or
[*][*][*], it did not work.

George

The REPLACE() function should work, if you have A2002 or later: run an
Update query updating the field to

Replace([fieldname], "***", "your different string")

A criterion of

LIKE "*[*][*][*]*"

will find the records containing ***; you need the leading and
trailing asterisks as true wildcards, the brackets treat the other
three asterisks as literal.
 
My data contains strings of three asterisks followed by few spaces, I
need to replace the them with different string. How to input them into
query so they are not considered "wildcards?" I tried [***] or
[*][*][*], it did not work.

George

What version of Access?
This works for me in an Access 2002 query:
exp: Replace([FieldName],"***","789")

Some versions of Access 2000 will not be able to process the above
function directly in the query.
Simply make a user defined function that calls the Replace() function
in a public module. Then call that user defined function from the
query.

For Access 97, you will need to write a complete user defined
function.
You would use InStr() and Mid() to locate and replace the "***".
 
Back
Top