I wrote a sql that does the following, But I am not getting correct results:
--get past 13 month contact records for all members/contacts in base table AllEnc.
FROM AllEnc f
WHERE ContactDate BETWEEN DATEADD(month, -18, f.ContactDate ) AND DATEADD(day, -1, f.ContactDate )
Then I am extracting records from AllEnc a
left join #enc18mts t on ContactNumber
where t.ContactNumber is null
Thanks for your help.