Query for Double Quotes / Quotation Marks

D

Dawg House Inc

I am trying to query in Access for a value in a field that contains a
quotation mark (or double quote).

Example: Field1 value = "Mr. John Smith

I want to:
SELECT * FROM tbl1
WHERE Field1 Like """ (which I know doesn't work)

How do I treat the middle quotation mark as an explicit value? I thought you
could a forward or backward slash, but those aren't working either.

Deadline looms.

Thanks in advance.
JCH
 
F

fredg

I am trying to query in Access for a value in a field that contains a
quotation mark (or double quote).

Example: Field1 value = "Mr. John Smith

I want to:
SELECT * FROM tbl1
WHERE Field1 Like """ (which I know doesn't work)

How do I treat the middle quotation mark as an explicit value? I thought you
could a forward or backward slash, but those aren't working either.

Deadline looms.

Thanks in advance.
JCH

Take your pick:
WHERE InStr([Field1],Chr(34)) > 0

or..

WHERE InStr([LastName],'"') > 0
(for clarity ,' " ')

or..

WHERE [Field1] Like "*" & Chr(34) & "*"

or..

WHERE [Field1] Like "*" & '"' & "*"
(for clarity Like "*" & ' " ' & "*")
 
D

Dale Fye

Or

WHERE [Field1] Like '*["]*'

--
Email address is not valid.
Please reply to newsgroup only.


fredg said:
I am trying to query in Access for a value in a field that contains a
quotation mark (or double quote).

Example: Field1 value = "Mr. John Smith

I want to:
SELECT * FROM tbl1
WHERE Field1 Like """ (which I know doesn't work)

How do I treat the middle quotation mark as an explicit value? I thought you
could a forward or backward slash, but those aren't working either.

Deadline looms.

Thanks in advance.
JCH

Take your pick:
WHERE InStr([Field1],Chr(34)) > 0

or..

WHERE InStr([LastName],'"') > 0
(for clarity ,' " ')

or..

WHERE [Field1] Like "*" & Chr(34) & "*"

or..

WHERE [Field1] Like "*" & '"' & "*"
(for clarity Like "*" & ' " ' & "*")
 

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