Is there a way to automate this process?
I have a query that finds the "Drop Offs" by doing an unmatch query against the hard table and the live table.
I want to automatically pull these "Drop Offs" out of the Hard table.
my sql for the query I am running follows:
1st Query - pulls the data from the live tables.
SELECT vewEmployeeLogin.PersonID, vewEmployeeLogin.User AS LOGIN, " " AS [PASSWORD], vewEmployeeLogin.[First Name] AS [FIRST NAME], vewEmployeeLogin.[Last Name] AS [LAST NAME], Max(IIf([TELECOMMTYPEID]=2,[TELECOMMVALUE],"")) AS EMAIL, Max(IIf([TELECOMMTYPEID]=1,[TELECOMMVALUE],"")) AS PHONE, "YES" AS EmployeeActive
FROM ((tblEmployee LEFT JOIN tblPerson_Telecomm ON tblEmployee.PersonId = tblPerson_Telecomm.PersonID) LEFT JOIN tblTelecomm ON tblPerson_Telecomm.TelecommID = tblTelecomm.TelecommID) RIGHT JOIN vewEmployeeLogin ON tblEmployee.PersonId = vewEmployeeLogin.PersonID
GROUP BY vewEmployeeLogin.PersonID, vewEmployeeLogin.User, vewEmployeeLogin.[First Name], vewEmployeeLogin.[Last Name], "YES";
2nd query - compairs data in Hard Table to the Live table and spits out the unmatched ones.
SELECT tblCRCTPanasonicLMSOriginal.PersonID, tblCRCTPanasonicLMSOriginal.LOGIN, tblCRCTPanasonicLMSOriginal.PASSWORD, tblCRCTPanasonicLMSOriginal.[FIRST NAME], tblCRCTPanasonicLMSOriginal.[LAST NAME], tblCRCTPanasonicLMSOriginal.EMAIL, tblCRCTPanasonicLMSOriginal.PHONE, tblCRCTPanasonicLMSOriginal.STATUS
FROM tblCRCTPanasonicLMSOriginal LEFT JOIN qryCRCTPanasonicLMS ON tblCRCTPanasonicLMSOriginal.PersonID = qryCRCTPanasonicLMS.PersonID
WHERE (((qryCRCTPanasonicLMS.PersonID) Is Null));
Hard Table is the results of the 1st query that I pulled a week ago.
Live Table is a combination of several tables on and SQL Server - which is what the 1st query pulls.
Any help would be nice in creating some sort of delete query to delete the records pulled by the 2nd query from the Hard Table.
Thanks!
Sophie