Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Escaping the ' character

Status
Not open for further replies.

sevex

Programmer
Joined
Sep 18, 2001
Messages
74
Location
CA
I'm trying to query an access database, and it won't let me use double quotations around my condition, but the condition has a ' character. how can I escape an apostrophe?

Thanks
 
Have you tried wrapping it around a PreserveSingleQuotes function?

e.g

Where field = #PreserveSingleQuotes(myvar)#
 
Use a 2nd apostraphe to escape the first one:

SELECT * FROM TABLE
WHERE field = 'Can''t' - tleish
 
ohhh, why didn't I think of that. In the end I just assigned it to a variable and let coldfusion do it automatically :P

thanks again tleish
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top