A field in the database contains for example, the word Lowe's with the apostrophe. I want to be able to search for that string. When the apost. is used, CF errors out. I can currently sure for lowe becuase I'm using LIKE in the query however lowes returns none and lowe's errors. Using Access database
error:
Syntax error (missing operator) in query expression 'STATE LIKE '%ca%' AND STORENAME LIKE '%Lowe's%''.
Query:
<CFQUERY NAME="GETSEARCH" DATASOURCE="#request.datasourcename#">
SELECT ID, STORENAME, SHOPPINGLOCATION, STREETADDRESS, CITY, STATE, ZIP, REGION, AREACODE, PHONE, EXT, TITLE, FIRSTNAME, LASTNAME, LASTVERIFIED, Notes1, Notes2
FROM My_DB
WHERE #preservesinglequotes(session.sqlHold)#
</CFQUERY>
DeZiner
Never be afraid to try something new.
Remember that amateurs built the Ark.
Professionals built the Titanic
error:
Syntax error (missing operator) in query expression 'STATE LIKE '%ca%' AND STORENAME LIKE '%Lowe's%''.
Query:
<CFQUERY NAME="GETSEARCH" DATASOURCE="#request.datasourcename#">
SELECT ID, STORENAME, SHOPPINGLOCATION, STREETADDRESS, CITY, STATE, ZIP, REGION, AREACODE, PHONE, EXT, TITLE, FIRSTNAME, LASTNAME, LASTVERIFIED, Notes1, Notes2
FROM My_DB
WHERE #preservesinglequotes(session.sqlHold)#
</CFQUERY>
DeZiner
Never be afraid to try something new.
Remember that amateurs built the Ark.
Professionals built the Titanic