0

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.

1 Answer 1

6

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')

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .