function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Bill ButtonBill Button 

SOQL Syntax using or

Hi,
 
I am having toruble with a simple or statement, the following works when the first condition is true but not on the second condition
 
integer AssignmentRegionOnly = [select Count() from Assignment__c where Country__c = :a.Country and (State_County__c = :a.State or State_aka__c = :a.state) and brand__c includes (:a.brand__C)];
Regards
Bill
jrotensteinjrotenstein
Could you please give us some examples of Input Values where the query (a) does and (b) does not work?
Bill ButtonBill Button

Hi,

I found the error in my code, it was in some previous code and any records that would have met the condition did not make it this far in my trigger.

Thanks for the response.

Bill