Alternative to a Union Query

nancybrown

Well-known Member
Joined
Apr 7, 2005
Messages
868
Is there an alternative to a Union query that will join "all" records from two tables . . . need flexibility to update, modify, and build additional queries.

Many thanks.
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.

james_lankford

Well-known Member
Joined
Jan 11, 2009
Messages
1,207
select *
from t1
union all
select *
from t2

but they must have the same # of columns and column types
 

nancybrown

Well-known Member
Joined
Apr 7, 2005
Messages
868
To further explain because I'm not always clear in what I'm trying to achieve. I need to bring in "one" column from a 2008 terms file and match by vendor ID into 2009 terms file table. I was successful in creating queries to get same terms and no change terms, but now I need all terms in one file showing before and after . . . but again, I only need to bring in one field to display side-by-side in the 2009 file. If it can't be done in Access, I suppose I can do a match statement in Excel and import it in to Access. I appreciate any suggestions
 

james_lankford

Well-known Member
Joined
Jan 11, 2009
Messages
1,207
still not sure what you want, but this brings in one filed from the 2009 table and one from the 2008 able and displays them side by side
Code:
select 
  t9.column1,
  t8.column1
from
  2009table as t9
  left join
  2008table as t8
on
  t9.vendorID = t8.vendorID
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,163,707
Messages
5,833,241
Members
430,199
Latest member
Petty queen

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