Union Query with Lookup?

dswift

New Member
Joined
Oct 24, 2017
Messages
21
I have a union query pulling information from two underlying tables. The underlying tables are using lookups to display a name instead of the primary key, so the data pulled in to the union query is the unique ID (numerical value). Is it possible to edit the SQL code in the union query to display the text like the lookups do in the underlying tables? I am self-taught in SQL and access in general so any guidance is appreciated.
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Join the tables and use the lookup field in the query instead?
 
Upvote 0
Seems like you should be able to use the lookup tables (again) to get the descriptions/names that go with the IDs. I'm not clear where you want to see this data (in the table? In another query? In a form?)

In general you *DO* want the table to store IDs if those are the keys. Most experienced db developers would not rely on lookups in tables in any way - this will cause you problems you don't need.
 
Upvote 0
I need to keep the tables separate unfortunately.

They are separate?
You just join the tables in the query with the common field and bring in the name with the rest of the data.?
 
Upvote 0

Forum statistics

Threads
1,224,830
Messages
6,181,229
Members
453,026
Latest member
cknader

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