You need to sign in to do that
Don't have an account?
NinoJose
Example:
HELP! Using Like on Apex Code.
Hi Guys,
Can somebody shed some light on me I'm loosing my hair trying to figure out whats the problem in my Apex Code.
Im using Like in my SOQL to some some record using a String variable for my like expression.
Example:
String myValue = '\'%' + somevalues + '%\';
List<Account> = new List<Account>([Select Id, Name from Account where customField like :myvalue]);
however it does not return and any row but when I used the Apex Explorer to query the same soql expression it gives the records, same as when I put the value directly in my SOQL query inside the initialization code of the List above.
Am I missing something?? Need you feedback guys. Any help will be appreciated.
Thanks,
Superfell
Why do you have a \ in front of the %, that means you're querying for the literal character %, not using it as a wildcard.
NinoJose
Hi Simon,
Thanks for the reply. The changes was great and it works!
Thanks,
Nino