Can anyone tell me what's wrong with this query?
INSERT INTO Employees ( Title, FirstName, LastName, Company, Department, Mailstop, Extension, City, State, Bldg, Floor, DirList, Prefix, Notes, Phone, importID, importDate, [Desc] )
SELECT Title, FirstName, LastName, Company, Department, Mailstop, Extension, City, State, Bldg, Floor, DirList, Prefix, Notes, Phone, importID, importDate, [Desc]
FROM dbo_Employees
WHERE dbo_Employees.importID NOT IN (SELECT Employees.importID FROM Employees);
I'll swear that this query worked fine when I first wrote it but when I came back to use it again this week it wont work. I don't get any errors but it wants to update 0 Rows.
Now, I am able to easily look at the data in the Employees table and verify that there are records in the dbo_Employees table where the dbo_Employees.importID number is NOT IN Employees.importID. Can anyone explain?
INSERT INTO Employees ( Title, FirstName, LastName, Company, Department, Mailstop, Extension, City, State, Bldg, Floor, DirList, Prefix, Notes, Phone, importID, importDate, [Desc] )
SELECT Title, FirstName, LastName, Company, Department, Mailstop, Extension, City, State, Bldg, Floor, DirList, Prefix, Notes, Phone, importID, importDate, [Desc]
FROM dbo_Employees
WHERE dbo_Employees.importID NOT IN (SELECT Employees.importID FROM Employees);
I'll swear that this query worked fine when I first wrote it but when I came back to use it again this week it wont work. I don't get any errors but it wants to update 0 Rows.
Now, I am able to easily look at the data in the Employees table and verify that there are records in the dbo_Employees table where the dbo_Employees.importID number is NOT IN Employees.importID. Can anyone explain?