Using Single Quotes in DataBase

  • Thread starter Thread starter Guest
  • Start date Start date
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.
 
You just have to make it a double-single-quote:

Select * FROM myTable WHERE myfield = 'Owner''s Text Book'
 
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'
 
Back
Top