Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Update multi File

Author  Topic 

issam
Starting Member

30 Posts

Posted - 2007-08-24 : 04:30:14
Hi,
I have the following case:-

File a(transaction File)__File b(summary File)___File c(summary)
acctno___Value DB/CR_____Acctno DB,CR_______acctno DB,CR
1___________100db___________1______________________1
1___________300cr___________2______________________2
1___________600db
2___________700db

I want to update the account on table b and c from table a.

My current update is just for one table as follows:-
UPDATE amaster
SET cmdb = cmdb +
(SELECT SUM(transact.damt) AS Expr1
FROM transact
WHERE (acctno = amaster.acctno)
GROUP BY acctno),
cmcr = cmcr +
(SELECT SUM(transact.camt) AS Expr1
FROM transact
WHERE (acctno = amaster.acctno)
GROUP BY acctno)
FROM amaster INNER JOIN
transact ON transact.acctno = amaster.acctno



thanks

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-08-24 : 06:02:39
You can't UPDATE two tables in one statement.



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page
   

- Advertisement -