You need to sign in to do that
Don't have an account?
ygutierrez
Query Error - Unexpected token
(.NET ASP C# 1.1) I get the following error when using the quote symbol ' in the WHERE clause
Error: Query Company by name: MALFORMED_QUERY:
from Lead where Company = 'D.G.O'Dell, Inc.'
ERROR at Row:1:Column:44
unexpected token: Dell
I've tried to replace ' with \' before I build the query but I keep getting the same error. The replace doesn't work.
Please let me know if you already solved this problem. I keep googling this but I cannot find anything. I think it should be very simple.
Thanks,
Yesenia
Replacing ' with \' should solve your problem. Please recheck your Query.
If your intial Query is Select Name from Lead where Company = 'D.G.O'Dell, Inc.' then your Query should look like Select Name from Lead where Company = 'D.G.O\'Dell, Inc.'
I changed it to string sTempCompany = sCompany.Replace("'", \\');
Now everything is ok. When I test this line I see the right result: select id from Lead where Company = 'D.G.O\'Dell, Inc.'