0

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?

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
0

How about...

SELECT Id, CampaignId, ContactId, CreatedById, CreatedDate, FirstRespondedDate, HasResponded, IsDeleted, LastModifiedById, LastModifiedDate, LeadId, Status FROM CampaignMember WHERE CampaignId IN (SELECT Id FROM Campaign where CreatedDate > 2013-04-01T00:00:00Z)

?

1
  • please upvote if you like it – Rafael Suarez Apr 22 '15 at 6:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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