• the logic is the same...it's just the test condition that changes:

    don't think you wan t not exists...you want to confirm that there is at least one row on TableC that is not in tableB:

    IF EXISTS (SELECT 1 FROM TableC LEFT OUTER JOIN ON TABLEC.ID = TABLEB.ID WHERE TableC.fieldname = 'Y' and TableB.fieldname is null)

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!