Help with update statement across tables

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.
 
Sorry. This one seemed to slip through the cracks...

Any chance that you could upload a sample copy of your database with some dummy (non-sensitive) data to some file sharing site?
I think it might be best if I could see what your database actually looks like.
 
Upvote 0

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.

Forum statistics

Threads
1,214,649
Messages
6,120,733
Members
448,987
Latest member
marion_davis

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top