+ Start a Discussion
wt35wt35 

SOQL question: Can I use the AND operator?

Hello

 

I need to get a list of cases where two conditions are met, hence my question, can I use the AND operator in a SOQL, such as here:

 

List<Case> c = new List<Case> ();
        c = [SELECT Id,CaseNumber,OwnerId FROM Case WHERE AccountId = :a.Id AND IsClosed = FALSE];

 

Thank you

Marc

 

Best Answer chosen by Admin (Salesforce Developers) 
zachelrathzachelrath

Yes, you can use AND, OR, etc. in SOQL queries. Your query should work fine.