I know how to join these two tables (invoices and payables). Payables has a balancedue
column and I need to make that the same as Invoices.originalamount
.
What I have written is:
update payables p
set p.balancedue= i.originalamount
From payables p
join invoices i on p.id=i.id
where nationalaccountcode='xxx'
But i'm getting an error. Any help? SSMS 2012, if that helps.