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
 SQL Server 2005 Forums
 Transact-SQL (2005)
 I need help

Author  Topic 

shaik.zakeer
Posting Yak Master

117 Posts

Posted - 2008-04-23 : 01:30:58
I have a table like

perpose month totaltobepaid paidamount balance

car loan jan 525000.00 10000.00 515000.00
two wheeler jan 50000.00 2500.00 47500.00
car loan feb 515000.00 10000.00 505000.00
two wheeler feb 47500.00 2500.00 45000.00

whenever i am going to pay due for the next month, it has to be reduced from the balance amount.

how can i do this.



dineshrajan_it
Posting Yak Master

217 Posts

Posted - 2008-04-23 : 01:46:26
Hi

just use update statement

update table1
set balance = totaltobepaid -paidamount
where condition

its better not to use balance column and can be validated at front end.
Go to Top of Page
   

- Advertisement -