Subquery Question

  • Thread starter Thread starter Mark via AccessMonster.com
  • Start date Start date
M

Mark via AccessMonster.com

Good day,

I am having a problem with a subquery and was wondering if there is a better
way to get the result needed. I have a table with customers and need to
exclude some of them based on a listing in a query that I created. The query
that I am trying to run is:

Select customer
From tablename
Where customer not in (Select customer from queryname)

The db times out when I run the query! The total number of records in table
(a) is 13135 and only (15) in the subquery (15).

Thank you in advance for the help provided.
 
Unless you've simplified the example for this post, you may find it easier
to use a frustrated outer join instead of a subquery.

The Unmatched Query Wizard can create this for you.
Tell it you want the records from the table that are not in the saved query.
 
Thank you Allen very much it worked. I do not know why I didn't think of that,
I think I was over thinking it.

Allen said:
Unless you've simplified the example for this post, you may find it easier
to use a frustrated outer join instead of a subquery.

The Unmatched Query Wizard can create this for you.
Tell it you want the records from the table that are not in the saved query.
Good day,
[quoted text clipped - 14 lines]
Thank you in advance for the help provided.
 
Back
Top