J -
I think you have to do it in two steps (I don't think aggregate
functions can be used w/ multi table updates). I wasn't sure which
columns belonged to which tables so look this over carefully:
Create Temp View FamTtl (FamNo, FamTtl) as +
sel FamNo, (sum(AR)) +
from StmtDet +
group by FamNo +
whe InvDate > (.#date - 30)
Update StmtBill +
Set Col1= t3.FamTtl +
from StmtBill t1, +
FamTtl t2 +
where t1.FamNo = t2.FamNo
Ben Petersen
On 1 Nov 2002, at 16:22, J BLAUSTEIN wrote:
> I am trying to update a column from another table sum without using a
> view - I used: update stmtbill set col1= (sum(ar)) from stmtbill t1,
> stmtdet t2 where t1.famno = t2.famno +
> and invdate > (.#date -30)
> any help would be appreciated
> J
>
> ================================================
> TO SEE MESSAGE POSTING GUIDELINES:
> Send a plain text email to [EMAIL PROTECTED]
> In the message body, put just two words: INTRO rbase-l
> ================================================
> TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED] In
> the message body, put just two words: UNSUBSCRIBE rbase-l
> ================================================ TO SEARCH ARCHIVES:
> http://www.mail-archive.com/rbase-l%40sonetmail.com/
>
================================================
TO SEE MESSAGE POSTING GUIDELINES:
Send a plain text email to [EMAIL PROTECTED]
In the message body, put just two words: INTRO rbase-l
================================================
TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED]
In the message body, put just two words: UNSUBSCRIBE rbase-l
================================================
TO SEARCH ARCHIVES:
http://www.mail-archive.com/rbase-l%40sonetmail.com/