I have two tables:
Well, if you are going to work with SQL you really should learn at least the basics, and joins are a basic part of the language.
I will show you an example that selects all records from
tblPayroll that does not have a matching
tblKPI, but you know what they say -
give a man a fish and he will eat for a day. Teach him how to fish and we will sit around in a bout drinking beer all day...
SELECT * FROM tblPayroll p WHERE NOT EXISTS ( SELECT 1 FROM tblKPI k WHERE k.Payroll = p.Payroll )