View Full Version : Query Adding value from 2 different tables


Marnelle
10-11-2009, 07:43 PM
Hello,

can somebody help me pls., i got stuck on this


TransactionTable1
-date_of _transaction (date of transaction is compose of many items)

item quantity
A 30
B 35




TransactionTable2
-date_of_transaction (date of transaction is compose of many items)

item quantity
A 30
B 10



Main_table

item Beginning_balance deduction ending-balance
A 100 30+30=60 40
B 100 35+10=45 55


deduction field from main_table is the sum quantity of transactioTable1and transactioTable2

pbaldy
10-11-2009, 07:54 PM
You probably shouldn't have 2 transaction tables, but I would probably use a UNION query to pull the 2 tables into one data set and then a totals query to group/sum the data by item (and date if appropriate). That should give you your deduction amount.

khawar
10-11-2009, 07:56 PM
Where does this beginning balance come from and if A is repeated more than once then you want sum of all qty or want to show each individual item