SQL: NOT IN (Select tradeid from qryGroup1;)

leeloo0505

Board Regular
Joined
Mar 28, 2003
Messages
130
Hello,

I need to make three seperate groups of trades. I have one file with all the data in it and have queried it and gotten results for one group. After identifying those trades by ID.. I need to get the remaining ID's that were not in my results.
Using the Design View of queries, I have tried selecting the tradeid from the main file and then in the criteria by writing: NOT In (Select tradeid from qrygroup1;). The query will just run for a very long time, I don't know if its working or not? Any other ideas?

thanks,
leeloo
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
I think that the way you're trying to do it will eventually work, but here's a better way. Join the two queries together on the ID field. Make the Join Type an Outer Join, returning all records from qrygroup2. Pull down the ID field from qryGroup1 deselect 'Show', and in the criteria for the field, write 'Is Null'. The Find Unmatched wizard, by the way, will perform this task for you.
 
Upvote 0

Forum statistics

Threads
1,221,638
Messages
6,160,994
Members
451,682
Latest member
ogoreo

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top