You need to sign in to do that
Don't have an account?
Alexandra Stehman
Querying for Campaign Member data for campaigns in a date range
I am trying to find campaign members for campaigns executed in last 2 years (not via Apex), in order to migrate this data (using Jitterbit).
I have tried couple different queries (from developer console) and can't seem to get the right query. Campaign is a lookup on CampaignMember, so should I not be able to use the __r notation to access?
I have tried couple different queries (from developer console) and can't seem to get the right query. Campaign is a lookup on CampaignMember, so should I not be able to use the __r notation to access?
SELECT Id, CampaignId, ContactId, CreatedById, CreatedDate, FirstRespondedDate, HasResponded, IsDeleted, LastModifiedById, LastModifiedDate, LeadId, Status, SystemModstamp FROM CampaignMember where CampaignId = Campaign__r.id and Campaign__r.CreatedDate >= LAST_N_YEARS:2
Please try below query,As it is standard relationship so no need to use '--r' .
Let us know if it helps.
Thank you. I did try that initially. I get 'bind variables' error: