Query that Looks up values in another table

atgordon

Board Regular
Joined
Nov 17, 2004
Messages
118
I have 2 tables that have invoice number. In the query I am using to pull fields from one of the tables, I would like a column that checks to see if the invoice number present in table 1 is also in table 2 and if so, the word Yes is displayed in that row. If not, No is displayed in that row.

In essence, when run, the query would show all the info from Table 1 except for the column "invoice number check," in which case it would check if that invoice number is present in Table 2 and if so, it would display yes for that row.

I am not sure if I need to use a Select function in the calculated field or what.

Hopefully this makes some sense and is not too confusing.
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
You could perhaps use one of the aggregrate functions. eg DLookUp, DCount
 
Upvote 0

Forum statistics

Threads
1,215,593
Messages
6,125,722
Members
449,255
Latest member
whatdoido

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