Re: a search and replace query

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



On Tue, 29 Jan 2008 18:59:00 -0800, Southern at Heart
<SouthernatHeart@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

I need a simple update query to find the & sign and replace it with {and}
...the & sign gives trouble on down the road. Can someone please show me how
to do this in a query? I know it should be hard, but my brain seems froze!
thanks.
oh, my table I'm searching is tblContacts and the field is HomeAddressStreet
thanks kindly.

UPDATE tblContacts
SET HomeAddressStreet = Replace([HomeAddressStreet], "&", "{and}")
WHERE HomeAddressStreet LIKE "*[&]*";

should do it.


John W. Vinson [MVP]
.



Relevant Pages

  • Re: Dcount revisted
    ... another query I am having trouble with. ... MVP ... when I enter this dcount statement I get the error ...
    (microsoft.public.access.queries)
  • Re: Query result displays NON selected fields
    ... Trouble is, the answer table shows every field from every table. ... How can I get a result with ONLY the fields I've check marked in the query? ... John W. Vinson [MVP] ...
    (microsoft.public.access.queries)
  • iif
    ... Create a Calculated Field in your Query with: ... Van T. Dinh ... MVP ... >i'm having trouble at the moment with a query, ...
    (microsoft.public.access.queries)
  • Re: Special Character #
    ... I'm trying to query a desc field that has '' in it. ... It looks like it's the '#' symbol that's causing the trouble. ... John W. Vinson [MVP] ...
    (microsoft.public.access.queries)
  • RE: Access 2007 - Overflow + error 2950 when running a macro
    ... Is the error a stack overflow or a numeric overflow? ... You usually have to look at the data that is causing trouble ... Through your tip I could restrict the query ...
    (microsoft.public.access.macros)