I have to get records whose picklist value is x and y. I wrote a sqol in developer console I am not getting result. If I do separate search for x and y. I am getting result. else I am not getting any result. SELECT AccountID From Contract Where Status = 'x , y'
. Is this the way to write or anything I need to change. The picklist status is no multiselect.
Add a comment
|
1 Answer
Try this:
String[] values = new String[] {'x', 'y'};
Contract[] contracts = [SELECT AccountID From Contract Where Status in :values];
Or
SELECT AccountID From Contract Where Status in ('x', 'y')