Count contacts who are associated with campaigns

  • Thread starter Thread starter VLee.KHer
  • Start date Start date
V

VLee.KHer

I have a query which pulls contact IDs from a table and links them to
Campaign IDs from another table. So, a contact ID will show up more
than once if it is linked to more than one campaign.

What I need to do is count how many campaigns each contact is link to
based on the contact ID. How would I do that?
 
Try this --
SELECT CONTACT.ContactID, Count(Campaign.CampaignID) AS CountOfCampaignID
FROM CONTACT INNER JOIN Campaign ON CONTACT.ContactID = Campaign.ContactID
GROUP BY CONTACT.ContactID;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top