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

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,300
Office Version
  1. 365
Platform
  1. Windows
You could perhaps use one of the aggregrate functions. eg DLookUp, DCount
 

Forum statistics

Threads
1,136,260
Messages
5,674,700
Members
419,520
Latest member
Jennifer4Dillon

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