How to search by a text field containing "?

D

DMC

I have a table that holds client registration info in a Access 2003 database.
Some of the client first names contain "", e.g., John"NE" or Mary "DEC" etc.
Does anyone know how I can search for those records that have "" in FirstName
field?
Thanks!
 
J

John W. Vinson

I have a table that holds client registration info in a Access 2003 database.
Some of the client first names contain "", e.g., John"NE" or Mary "DEC" etc.
Does anyone know how I can search for those records that have "" in FirstName
field?
Thanks!

Use a criterion of

LIKE '*"*'

The ' delimiters will prevent trouble with " being confused with a delimiter
rather than a search term.

John W. Vinson [MVP]
 
D

DMC

Thanks Karl, Ofer and John!

I tested all of the three suggestions:
1. Like "*" & Chr(34) & "*"
2. Like "*""*"
3. LIKE '*"*'
1 and 3 return the same record set, which is exactly what I want;
2 returns only one record, which contains two consecutive quotes: ""

Cool! Thanks again!
 

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