+ Start a Discussion
VFVF 

query in soql

Hello,
 
i have a problem in retrieving  soql query with mulitple conditions.
 
select leadid,contactid from CampaignMember where campaignmember.lead.Department='Test'  and
campaignmember.contact.Company='Test'
 is not working while its working for seperate single condition.
Is there any query to  retrieve based on multiple conditions as of above. 
Your help is appreciated thanks in advance.
 
shaan 
prageethprageeth

Hello VF;

I don't know your requirement but I think you need to use "OR" instead of "AND".

  See below,

select leadid,contactid from CampaignMember where campaignmember.lead.Department='Test' OR campaignmember.contact.Company='Test'

 

 

Message Edited by prageeth on 11-05-2009 04:41 AM
SuperfellSuperfell
Well, a given campaignmember row is for a lead or a contact, so the your where clause is never true.