Sorry, contractid is from my real case, I missed it when doing the replace to match the name I used for the example case. It's the correct field name for the data I'm working on.
I believe I have found the source of my problem. CompanyEmployee contains some rows that have EmployeeId=NULL (for reasons outside the scope of this example, and I have no control over that).
As a result, the NOT IN clause doesn't work because one of the value in the subquery is NULL. That makes sense.
I need a way to make LLBL emit
DELETE FROM [EMPLOYEE] WHERE ( ( NOT [EMPLOYEE].[id] IN (SELECT [COMPANYEMPLOYEE].[EmployeeId] AS [EmployeeId] FROM [COMPANYEMPLOYEE] WHERE EmployeeId IS NOT NULL )))
How can I get this result using the fieldcomparesetpredicate, please?