Simple query

vavs

Well-known Member
Joined
Jul 2, 2004
Messages
514
I think this should be a simple query but I am not getting the results I am looking for.

I have two tables, each with a single column of data containing Purchase Order numbers.

I need to find if a number exists in the first table but not in the second table.

The query I used was:

Select PONUM
from PS,AV
where PS.PONUM <> AV.PONUM

I basically end up with all of the rows from PS.PONUM

I am an ACCESS novice. I can do this in Excel but the number of rows (160000) is too much to handle in Excel.
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Try using the Find Unmatched Query Wizard. It will walk you through all of the steps (and you can view the SQL when done, if you like).

Simply click on New from the Query Object section and select "Find Unmatched Query Wizard"
 
Upvote 0
Try using the Find Unmatched Query Wizard. It will walk you through all of the steps (and you can view the SQL when done, if you like).

Simply click on New from the Query Object section and select "Find Unmatched Query Wizard"

Just to add to the above:
Once you create the Unmatched Query, via the Wizard, test it to make sure it works, then open it in Design mode, click on the down arrow of the View button (left-most button in tool bar) and click on SQL View. This will show you the correct syntax for what you were trying to do. Might be helpful.
 
Upvote 0

Forum statistics

Threads
1,214,919
Messages
6,122,260
Members
449,075
Latest member
staticfluids

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