You need to sign in to do that
Don't have an account?
3421
Like Operator in SOQL System.QueryException: expecting a colon, found 'tempInput'
I am trying to use a string search in SOQL. I am getting error saying
System.QueryException: expecting a colon, found 'tempInput'
System.QueryException: expecting a colon, found 'tempInput'
string tempInput = '%' + 'GH' + '%'; String qryStr = 'SELECT Id, Name'; qryStr += ', Receipt__c'; qryStr += ', Class__c,'; qryStr += ' FROM Line__c'; qryStr += ' WHERE Receipt__r.Posted__c = true'; qryStr += ' AND Receipt__r.Description__c like tempInput' ; qryStr += ' AND Receipt__r.OPayment__c = null';
GhanshyamChoudhari
Dushyant Sonwar
You missed a ":" colon when using variable in the query.