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
Andrew TelfordAndrew Telford 

SOQL Query With WHERE based on Picklist value

Hi

I have a custom object ci_mailout and it has a picklist filed called mailout_name__c. When I create the following query, it tells me that there is an unexpected ';'. From what I can see there isn't anything unexpected. Is it something to do with the picklist??
 
objMailout = [SELECT Id, contact__c, contact__r.Name, recipient_first_name__c, recipient_last_name__c, caps__r.AccountID__c, file_password__c, email_address__c FROM ci_mailout__c WHERE Sent__c = FALSE, Mailout_name__c = :strTemplate_Initial ORDER BY Policy_count__C Desc LIMIT 250];

note that objMailout has been declared earlier (PUBLIC LIST <ci_mailout__c> objMailout;) in the script.
Best Answer chosen by Andrew Telford
Andrew TelfordAndrew Telford
Don't worry ... figured out I was being silly in my WHERE clause and added a , insteaf of AND ...