>Brilliant! That works perfectly. I thought of trying the EXISTS clause, but I just can not grasp the concept of how it works. I have studied it, but my mind just can not comprehend that particular nuance of the SQL language. Thanks!
>
>>Mark,
>>
>>Try
select distinct log_id from hlp_main_items hmt1
>> where NOT EXISTS
>> (SELECT * FROM Hlp_Main_Items hmt2
>> WHERE hmt2.log_id = hmt1.log_id AND hmt2.Completed IS NULL)
>>
BTW, it seems to me that your query should work also.
>
>Logically, I thought it should as well, but I was tired of fighting that battle. I gotta move on.
Mark,
if one child record exists surely, then scan parent table is sufficient,
and it return distinct for definition:
select log_id from hlp_main hmt1
where NOT EXISTS(SELECT * FROM Hlp_Main_Items WHERE log_id = hmt1.log_id AND Completed IS NULL)