3 subquery criteria question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have this criteria

WHERE (((tblImport_tmp.Model_No1) Not In (SELECT Model_No1 FROM tblHVAC)) AND ((tblImport_tmp.Manufacturer1) Not In (SELECT Manufacturer1 FROM tblHVAC)) AND ((tblImport_tmp.Model_No2) Not In (SELECT Model_No2 FROM tblHVAC)))

I want to append a record there all 3 conditions are met, namely the COMBINATION of Model_No1, Manufacturer1, AND Model_No2 do not exist in tblHVAC

In testing if the query worked properly, Model_No1 AND Manufacturer1 WERE IN tblHVAC but Model_No2 WAS NOT. Therefore, the query is supposed to append the record, however it is not appending anything. Is the sql criteria set up properly to append where all 3 conditions are met?
 
You might try a different way. Perhaps a select statement might look like the
following UNTESTED SQL statement.

SELECT FieldsInTable
FROM tblImport as I
WHERE 0 = (
SELECT Count(*)
FROM TblHVAC As T
WHERE T.Model_No1 = I.Model_No1 and
T.Manufacturer1 = I.Manufacturer1 and
T.Model_No2 = T.Model_No2)
 
Back
Top