How do Update fields with wildcard as a text

  • Thread starter Benjamins via AccessMonster.com
  • Start date
B

Benjamins via AccessMonster.com

Hi,

I have a update query "Update
Set [Field1] = 'O'Donnel' WHERE [Field2]
= 'Terry'"

It give me an error dur to the ' in O'Donnel. How do i Update/Insert
Wildcard.
 
T

Tom van Stiphout

On Mon, 18 May 2009 04:07:11 GMT, "Benjamins via AccessMonster.com"

Wildcard? Perhaps you meant "string terminator", because that's what a
single-quote is in some circumstances. Simply double-up on them:
Update
Set [Field1] = 'O''Donnel' WHERE [Field2] = 'Terry'

-Tom.
Microsoft Access MVP
 
M

Marshall Barton

Benjamins said:
I have a update query "Update
Set [Field1] = 'O'Donnel' WHERE [Field2]
= 'Terry'"

It give me an error dur to the ' in O'Donnel. How do i Update/Insert
Wildcard.



Or double up on the enclosing string delimiter:

"Update
Set [Field1] = ""O'Donnel"" WHERE [Field2] =
""Terry"""
 
F

fredg

Hi,

I have a update query "Update
Set [Field1] = 'O'Donnel' WHERE [Field2]
= 'Terry'"

It give me an error dur to the ' in O'Donnel. How do i Update/Insert
Wildcard.


I don't see any wildcards in your Update syntax.
I do see your problem however.
It has to do with the fact that your value O'Donnel has an apostrophe
within the surrounding apostrophes ('O'Donnel').
Use a double quote instead.

And why the quotes around the entire string?

Try:
Update
Set [Field1] = "O'Donnel" WHERE [Field2]
= "Terry"
 

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