Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top
  select name,Beds__c,Square_Footage__c,Initial_List_Price__c,Status__c 
    from Condo__c where name!=null 
     and Status__c = \'Unsold\' 
      OR Status__c = \'Available\'';
share|improve this question
3  
Read this article: Querying Multi-Select Picklists – Sergey Utko Mar 24 at 14:23
up vote 3 down vote accepted

USE IN for multiple values IN(option1, option2, option3, ...etc)

Query will be

select name,Beds__c,Square_Footage__c,Initial_List_Price__c,Status__c 
    from Condo__c where name!=null 
     and Status__c IN ('Unsold', 'Available')

String strQuery ='select name,Beds__c,Square_Footage__c,Initial_List_Price__c,Status__c '+
                 ' from Condo__c '+
                 ' where name!=null '+
                 ' and Status__c IN (\'Unsold\', \'Available\')'
share|improve this answer
2  
Thanks for the solution. now query runs correctly – chaitanya Mar 24 at 14:34

Based off some of the syntax you had, it looks like you using this in apex. If that's the case, there needs to be some other syntax added to what's below to get it to work. If you are using this in the data loader or anything else looking directly for a query, this will work.

Select name,Beds__c,Square_Footage__c,Initial_List_Price__c,Status__c 
from Condo__c where name!=null 
 and Status__c IN ('Unsold', 'Available')
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.