Type: MSSQL
Description: Find all contacts sent a certain attachment
SELECT
c1.contact
,c1.company
,ch.rectype
,mb.maildate
,c1.accountno
FROM
contact1 c1
JOIN conthist ch
ON c1.accountno=ch.accountno
JOIN mailbox mb
ON ch.recid = mb.linkrecid
WHERE
mb.maildate > '11/01/2007'
AND mb.rfc822 LIKE '%Put attachment filename here%'