View Full Version : Problem With Nest Query


mhong
03-03-2002, 01:36 AM
I have a nest query as below:
SELECT field1 FROM table1
WHERE field1 NOT IN
( SELECT field2 FROM table2
WHERE field3 = TRUE )
This query run fine as long as the second query ( the inner query ) have return at least one record.
But there is still a case where the second query does not return any record then my nest query will run forever.
Please help me how to fix this query.

Jack Cowley
03-03-2002, 08:39 AM
Use DCount to see if the first query returns any records before you run your query.

mhong
03-03-2002, 04:37 PM
You are right. Use Dcount would work. But I use this query at run time. Is there any solution that can always return a records in my query without using Dcount.
Thank for your help.