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
U JayU Jay 

Select query with multi picklistpicklist

I have to build a dynamic query.
I have a multi picklist with values(say X ) 'a','b','c' and 'd'.
I have to build a select query to fetch record where X contain 'b'.
How can i do it?
Amritesh SahuAmritesh Sahu
Hi,

String querystr = 'select id,x from Object where x includes (\'b\')';
objectlist = database.query(querystr);
You can view thsi page for more information
http://www.salesforce.com/us/developer/docs/officetoolkit/Content/sforce_api_calls_soql_querying_multiselect_picklists.htm

Hope this helps.
Regards.

Cloud_forceCloud_force
You will need to use include keyword and like below
ex:

from account where stage__c includes ('opne;new','closed')

thanks,
http://www.forcexplore.com/2014/07/wrapper-class-in-salesforce.html