Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 MS Access
 Subqueries in MS Access 2007

Author  Topic 

sqlslick
Yak Posting Veteran

83 Posts

Posted - 2009-10-29 : 16:12:41
Hello,

I am trying to run a query with 3 subqueries in the WHERE clause similar to this:

WHERE ITEM_NO NOT IN (SELECT ITEM_NO FROM...)
AND ITEM_NO NOT IN (SELECT ITEM_NO FROM...)
AND ITEM_NO NOT IN (SELECT ITEM_NO FROM...)

When I click on Run Query I can see the Running query progress bar fill up at the bottom but query doesn't seem to finish. The syntax is OK and infinite loop is out of the question. Anybody has any suggestions why this is happening?

Thanks!
J

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-11-23 : 09:32:40
Have you tried this?


select
.
.
from table t
WHERE
not exists
(
SELECT ITEM_NO FROM...where col=t.col
)
and
not exists
(
SELECT ITEM_NO FROM...where col=t.col
)
and
not exists
(
SELECT ITEM_NO FROM...where col=t.col
)


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -