Append into an entirely new table?

  • Thread starter Thread starter theseandavis
  • Start date Start date
T

theseandavis

Is it possible to append one table to another, with the result being an
entirely new table and not overwriting one or the other?

I have two tables in which I would like to sum a number of columns. I
just can't figure out how to do this without appending the two tables
together first (... just kinda teaching myself how to use this
program...)

For example:

Table 1:
1) a b c 1 2 3

Table 2:
#) a b c 4 5 6

Where a,b, and c are text so that if it all matches (ie. rows 1 and #
in this case match) I would like the summary results -> a b c 5 7 9. It
would be great to do this in a query without bringing together the two
tables first, but I dont see how:)

Thanks for any input.
 
Create a union query and then create a totals query that sums the union
query.
UnionQuery:
Select fldA, fldB, fldC From tblA
Union All Select fldA, fldB, fldC From tblB;

TotalsQuery:
Select fldA, fldB, Sum(fldC) as SumFldC
From UnionQuery
Group By fldA, fldB;

Sounds like you have a design problem. You probably shouldn't have two
separate tables with identical characteristics. A better design would be a
single table with a type code.
 
Thanks a TON for your help. That worked very well.

Its not really a design problem. Its a bunch of raw data from our
database that needs to be kept seperate for tracking purposes up until
now. The ultimate goal is, like you said, to eventually spit this back
into the database as a summary, yet retain the old records for various
areas that need that ability. Actually, if you saw the amount of work
to even get the two lists looking similar you would chuckle (and have
many bald bloody spots on your scalp, like me). Years of neglect...

Thanks again,

S
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top