Luckily there are some clever SQL boys here and they came up with the following query:-
SELECT COUNT(DISTINCT im.InboundMessageID) AS [Count],
mta.emailaddress AS [Address]
FROM dbo.MatchToAddresses mta
LEFT JOIN dbo.InboundMessages im
ON mta.emailaddress = im.EmailPrimaryTo
AND im.EmailDatetime > 'Specify date'
GROUP BY mta.emailaddress
ORDER BY mta.emailaddress
I now have a list of how many times in the past 6 months an email address has been hit. From the 250 email addresses, 130 have been hit 10 times or less, and many have not been hit at all. I now have a fun job of pruning the addresses and subsiquent ruleset. Joy!
No comments:
Post a Comment