Mark,
Usually RDBMS are optimized to process EXISTS subqueries because they don't return any data. In concept EXISTS subquery is close to VFP SEEK/INDEXSEEK or LOCATE.
>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.
--sb--