Primary Table and Archive Combine

jglassner

New Member
Joined
Apr 28, 2016
Messages
31
Office Version
365
Platform
Windows, MacOS
Hello

Before I ask the question I know if I had not created and archive table from my primary table I would not have this issue. However, offloading years of data that is not used all that much really sped things up.

So, now I been asked to run a report for the life of the project and I need to combine the data while keeping the tables separate. I am looking to combine certain data fields to get a count of the total. Both tables are exactly the same.

Example
Primary Table Project Date + Primary Archive Project Date.

I assume a query would be the answer but I can not seem to get the two tables to merge.

Thanks,
Jason
 

Some videos you may like

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.

JonXL

Active Member
Joined
Feb 5, 2018
Messages
354
Office Version
365, 2016
Platform
Windows
You want a UNION query. Something like...

SQL:
SELECT FIELD1, FIELD2
FROM ACTIVE_TABLE
UNION ALL
SELECT FIELD1, FIELD2
FROM ARCHIVE_TABLE
Save this as a query and then create new queries referencing it to pull all the reporting.
 

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
54,126
Office Version
365
Platform
Windows
so why you want to merge these two?
I'm just asking out of curiosity
I am pretty sure that they mean the table structures, not the table data.
 

sandy666

Well-known Member
Joined
Oct 24, 2015
Messages
6,359

ADVERTISEMENT

I am pretty sure that they mean the table structures, not the table data.
this is just your interpretation, I don't see the confirmation / denial from OP 😇
 

xenou

MrExcel MVP, Moderator
Joined
Mar 2, 2007
Messages
16,687
Office Version
2013
Platform
Windows
I would imagine JonXL is on the right track...

Note: UNION vs UNION ALL could make a difference. UNION by default will discard duplicates which may affect your count if there are duplicates...
 

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
54,126
Office Version
365
Platform
Windows

ADVERTISEMENT

this is just your interpretation, I don't see the confirmation / denial from OP
I think it can be pretty easily inferred, if you read the entire question in its context.
...However, offloading years of data that is not used all that much really sped things up.

So, now I been asked to run a report for the life of the project and I need to combine the data while keeping the tables separate.
 

Micron

Well-known Member
Joined
Jun 3, 2015
Messages
1,882
Office Version
365
Platform
Windows
I think it can be pretty easily inferred, if you read the entire question in its context.
Sometimes, only a part of it can be relied on. I'd defer to this statement as the rest is not crystal clear:
I need to combine the data while keeping the tables separate.
which I take to mean that data is to be temporarily merged as a query would do.
 

jglassner

New Member
Joined
Apr 28, 2016
Messages
31
Office Version
365
Platform
Windows, MacOS
You want a UNION query. Something like...

SQL:
SELECT FIELD1, FIELD2
FROM ACTIVE_TABLE
UNION ALL
SELECT FIELD1, FIELD2
FROM ARCHIVE_TABLE
Save this as a query and then create new queries referencing it to pull all the reporting.

THANK YOU
 

Subscribe on YouTube

Watch MrExcel Video

Forum statistics

Threads
1,106,264
Messages
5,510,204
Members
408,779
Latest member
Lermiapolar

This Week's Hot Topics

  • Turn fraction around
    Hello I need to turn a fraction around, for example I have 1/3 but I need to present as 3/1
  • TIme Clock record reformatting to ???
    Hello All, I'd like some help formatting this (Tbl-A)(Loaded via Power Query) [ATTACH type="full" width="511px" alt="PQdata.png"]22252[/ATTACH]...
  • TextBox Match
    hi, I am having a few issues with my code below, what I need it to do is when they enter a value in textbox8 (QTY) either 1,2 or 3 the 3 textboxes...
  • Using Large function based on Multiple Criteria
    Hello, I can't seem to get a Large formula to work based on two criteria's. I can easily get a oldest value based one value, but I'm struggling...
  • Can you check my code please
    Hi, Im going round in circles with a Compil Error End With Without With Here is the code [CODE=rich] Private Sub...
  • Combining 2 pivot tables into 1 chart
    Hello everyone, My question sounds simple but I do not know the answer. I have 2 pivot tables and 2 charts that go with this. However I want to...
Top