simple update querry help

K

Karine

Hi all,

so I have a title field with entries that look like this:
- america in Paris [An]

I want to change that title for
- america in Paris (An)

Since find/replace dont work (try it I cant explain), I need to do it
with a querry:

UPDATE tablename SET title = 'An'
WHERE title='[An]';

this work only if the [An] is alone in the title field, so I probably
need to add % or * somewhere to have the title change the [An] is
anywhere in the line?

thanks all

Karine
 
M

MGFoster

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Using ANSI SQL-92 syntax (Access 2002):

UPDATE tablename
SET [title] = Replace([title],"[An]","(An)")
WHERE [title] Like "%[[]An]%"

If you are using the SQL-89 syntax, change the wildcard % to an asterisk
*.
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQmf6CYechKqOuFEgEQItFgCfVT5tirXqZBwtcrzgOtFc9ZyvNhkAnjtN
z8Uufp6lPe3tyTZknfradsyr
=HvzP
-----END PGP SIGNATURE-----
 

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