Using Single Quotes in DataBase

G

Guest

I have a database which has a field "myfield" that has a value "Owner's Text
Book". I am trying to construct an sql query to find the record where
myfield equals "Owner's Text Book". How do I get the Sql query to accept
the single quote as part of the string I'm looking for,i.e.,

Select * FROM myTable WHERE myfield = 'Owner's Text Book'. The OLEDB query
command interprets the ' in Owner's as a delimiter.
 
T

Terry Olsen

You just have to make it a double-single-quote:

Select * FROM myTable WHERE myfield = 'Owner''s Text Book'
 
G

Guest

Thanks...that works!
--
Dennis in Houston


Terry Olsen said:
You just have to make it a double-single-quote:

Select * FROM myTable WHERE myfield = 'Owner''s Text Book'
 

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