Hollywood22
New Member
- Joined
- May 27, 2014
- Messages
- 9
Hi there I have 3 tables that house financial data. Table 1 is the master T1ID primary key and Amount the field I want updated, Table 2 is one level drilled down t2ID primary key and t1id foreign key and Amount the field I want updated, and table 3 is 2 levels drilled down t3id primary key t2id foreign key and Amount the source of the updates.
Basically I would like an update statement that would
update table2
set amount= sum(table3.amount)
where table2.t2Id = table3.t2id
and similarly
update table1
set amount = sum(table2.amount)
where table1.t1id = table2.t1ID
Apologies as my SQL knowledge is not access based. I've tried query builder and just straight SQL writing and cant seem to get the right values to work out.
Thanks so much.
Basically I would like an update statement that would
update table2
set amount= sum(table3.amount)
where table2.t2Id = table3.t2id
and similarly
update table1
set amount = sum(table2.amount)
where table1.t1id = table2.t1ID
Apologies as my SQL knowledge is not access based. I've tried query builder and just straight SQL writing and cant seem to get the right values to work out.
Thanks so much.