Query for sum fields

Mohamed Ali

New member
Local time
Today, 00:15
Joined
Apr 11, 2013
Messages
3
I'm trying to create a query that can sum values of different fields in different tables
can some help me plz! :)

there is another issue:
Can I sum values of a field and put the result into another field in different table?
 
Welcome Aboard:)
Join the tables. Select the columns you want to group by. Select the colums you want to sum. Press the big sigma button in the ribbon. Change the group by's to Sum's where appropriate.

You can't use an update query to do this since if any part of a query is not updateable, Access treats the whole query as not updateable. If you had to do this, you can sometimes make this work if the aggregation is done in a sub-select but usually, you need to turn it into a make-table query to save the aggregation and then run an update query that joins the temp table to the main table and updates it.

HOWEVER, it is almost always wrong to store calculated values since it violates normal forms. Normally you would just use a query to calculate the sums at runtime.
 
thnx for ur answer :)

but I have multiple table and I want to get sum of fields in different table
for example:
table1 has (ID,payment) ... table 2 (ID,payment) .... table3 (ID,payment)

and there is a relationship between every single table and a customer table
so I want to sum all the payment values for every single customer
is that possible?

thnx in advance :)
 
You can't join tbl1, tbl2, and tbl3 but you can Union them. Then create a query of the union to sum the payments.

If it is not too late, you should consider changing the schema to have only a single payment table, perhaps with a transaction code or status flag or what ever you need to distinguish the three options.
 

Users who are viewing this thread

Back
Top Bottom