How to use sum in SQL Update query.
Hi i want to achieve the following,
which is, the paidamt field in Student table shud be
equal to Sum of installment field (in table payments).
I wrote the following SQL but why it doesn't work..
thnx!
Mur3.
Hi i want to achieve the following,
which is, the paidamt field in Student table shud be
equal to Sum of installment field (in table payments).
I wrote the following SQL but why it doesn't work..
Code:
cn.Execute "update students as s,payment as p
set s.paidamt=s.paiadmt+sum(p.installment)
where s.regno=p.regno and s.regno=" & lngRegNo
thnx!
Mur3.