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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

single quotes in a query

Status
Not open for further replies.

gm456

Programmer
Aug 4, 2000
11
0
0
GB
How can I get an SQL query to work on a name that includes a quote mark -

eg: form.name contains o'donnell

SELECT *
FROM people
WHERE name like '%#preservesinglequotes(form.name)#%'

No matter what combination of single or double quotes I try, it ain't working, with or without preservesingle quotes

TIA guys! [sig][/sig]
 
Try this,

SELECT *
FROM people
WHERE name like '%#Replacelist(#form.name#,"'","''")#%'


This should work,

:) Perichazhi


[sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top