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

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
58,372
Office Version
  1. 365
Platform
  1. Windows
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"
 

MyBoo

Board Regular
Joined
Aug 9, 2006
Messages
217
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.
 

Forum statistics

Threads
1,136,878
Messages
5,678,302
Members
419,753
Latest member
Sallylwy

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
Top