1

My query looks like this:

return Database.getQueryLocator([SELECT Id, Updated_by_Contact__c, BillingStreet, BillingCity, BillingState, BillingCountry, BillingPostalCode, 
                                     ( SELECT Id FROM  Contacts WHERE Is_Synced__c = false ) 
                                     FROM Account 
                                     WHERE BillingStreet !=null  && BillingCity !=null && BillingState !=null && BillingCountry !=null && BillingPostalCode !=null ]);

So when I write this query above I'm getting an error saying

"Variable does not exist: BillingCity, BillingState..."

However, when I end the query at:

return Database.getQueryLocator([SELECT Id, Updated_by_Contact__c, BillingStreet, BillingCity, BillingState, BillingCountry, BillingPostalCode, 
                                     ( SELECT Id FROM  Contacts WHERE Is_Synced__c = false ) 
                                     FROM Account 
                                     WHERE BillingStreet !=null]);

I'm not getting any error and it's working perfectly fine. Could you please explain why is this happening?

1 Answer 1

2

"&&" does not work in SOQL. Please replace your "&&" with "AND" keyword.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.