Hi All, We have an SQL Databse that manages our CRM, a table in the database (tblCRMActivity) has a record in it for every time we have been in contact with a customer.
We want to be able to pull out every customer in the database that we have not had contact with in the last 30 days. Now I have been able to pull out all records that HAVE occurred in the last 30 days (code Below), but I need all customers that have had no contact with us in the last 3 days, basically the opposite.
Is this possible in SQL alone, or am I back to filtering records with some nested loops in VB.NET?
SELECT tblCompany.strCompanyName, tblCompany.ID
FROM tblCompany INNER JOIN
tblCRMActivity ON tblCompany.ID = tblCRMActivity.intCompanyID INNER JOIN
tblDomainAccountMap ON tblCRMActivity.intEngineerID = tblDomainAccountMap.intUserID
Where dtActionDate < DATEADD(day, -30, getdate())