4
  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\'';
1

2 Answers 2

4

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\')'
0
2

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

You must log in to answer this question.

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