Question
Texas Commission On Environmental Quality
US
Last activity: 30 Jul 2018 16:44 EDT
Using Like keyword in Connect SQL query
Hello,
Hope everybody is doing good.
I have a requirement where I want to find all results from database containing string entered by user. My primary goal is to achieve similar functionality of "Contains" as in Obj-Browse. Do we need to put any symbol to make "like" keyword work? I have tried following and none of them seems to work.
.LegalName is a property in which I am storing user input and using it in a query to compare against column LEGAL_NAME from DB.
1. WHERE ((T1.LEGAL_NAME like {.LegalName}) OR ({.LegalName} IS NULL))
2. WHERE ((T1.LEGAL_NAME like '%{.LegalName}%') OR ({.LegalName} IS NULL))
3. WHERE ((T1.LEGAL_NAME like {'%.LegalName%'}) OR ({.LegalName} IS NULL))
4. WHERE ((T1.LEGAL_NAME like {%.LegalName%}) OR ({.LegalName} IS NULL))
Kindly let me know if you need additional information from my end.
Your help is really appreciated. TIA
Regards,
Arpan Parikh