Newbie query help

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I have 3 tables as follows

TableA (can contain multiple entries of same partNo)
partNo
qtybin1
qtybin2
qtybin3

TableB (can contain multiple entries of same partNo)
partNo
qtybinX
qtybinY
qtybinZ

TableC
partNo
name
details
qty

Table C is an output table that already has entries for all part numbers
along with details and name. I want to sum all the entries from tables A and
B against any given part number and insert the value into TableC.

How can i go about this please?

I have experimented with appending the entries from A and B to a third table
H then doing a group on part number and summing the groups but complains when
try and do update query to insert results of query into Table C but it
complains when run latter.

Thoughts please?
 
I have experimented with appending the entries from A and B to a third table
H then doing a group on part number and summing the groups but complains when
try and do update query to insert results of query into Table C but it
complains when run latter.

No Totals query - nor any query *containing* a Totals query - is ever
updateable.

I'd suggest instead using a UNION query to string TableA and TableB
together; see UNION in the online help for an example. Then base a
Totals query on the UNION table, grouping on PartNo and summing the
quantities; change this Totals query to an Append query and append
into TableC (via TableH if you wish, though it's really probably not
necessary).

John W. Vinson[MVP]
 
Back
Top