You need to sign in to do that
Don't have an account?
Search result using Like operator in Where condition
Hi Team,
I am using below query to search the result.
searchquery='select title,id, UrlName, Summary, ArticleType from knowledgearticleversion where Title like \'%'+searchstring+'%\'';
We have three records with title 'Wi-Fi', but if i am searching with keyword WiFi there is no result. However if I am searching with exact Wi-Fi text only the results are coming.
Question: I want to build my query in such a way that if user enter Wifi or Wi-Fi the results should come.
Please let me know.
Thanks
Satheesh K
I am using below query to search the result.
searchquery='select title,id, UrlName, Summary, ArticleType from knowledgearticleversion where Title like \'%'+searchstring+'%\'';
We have three records with title 'Wi-Fi', but if i am searching with keyword WiFi there is no result. However if I am searching with exact Wi-Fi text only the results are coming.
Question: I want to build my query in such a way that if user enter Wifi or Wi-Fi the results should come.
Please let me know.
Thanks
Satheesh K
Thank you for your response,
String searchquery ='select title,id, UrlName, Summary, ArticleType from knowledgearticleversion where Title like \'%' +searchstring.replace('-','')+' OR '+ searchstring +'%\'';
The above query is not working for both the case means if i enter wifi or Wi-Fi.
Please help me
Thanks
Satheesh K
Compile Error: Found punctuation symbol or operator '%' that isn't valid in Apex