I have a tricky record selection question. I'm trying to select from our database all records from the Installer table (which holds labor cost data) that reference Invoice Numbers that reference Product Code 84, Product Code 84 and 85, but not Product Code 85 only. I don't believe my current SQL statement does this... I think it allows Invoice Number that reference exclusively Product Code 84, exclusively Product Code 85 or 84 and 85 together. Any suggestions?
SELECT Installer.Inv_Num, Installer.Pr_Code, Installer.RegHours, Installer.OvrHours,
Installer.DoubHours, Installer.MiscEarn, Installer.Rate, JobType.JobTypeFullName
FROM Installer, Header, JobType
WHERE Installer.Inv_Num = Header.Inv_Num AND Header.Job_Type = JobType.JobType AND
NOT Installer.Inv_Num IN
WHERE NOT Pr_Code IN ('84', '85')
AND LastName <> 'ASSESSMENT'
ORDER BY Installer.Inv_Num