As I understand you'll need to add a new record to the table, not update the first one:
Date....Desc...............Debit...........Credit........Balance
31/12....Outstanding Balance..............................7000
To do this you can create a stored procedure, something like this
Code:DECLARE @StartBal Money, @TurnOver Money, @EndBal Money; Select @StartBal = SUM(Balance) FROM [CASH BOOK] WHERE Date='1/1/2011'; Select @Turnover = SUM(Debit) - SUM(Credit) FROM [CASH BOOK]; Select @EndBal = @StartBal + @TurnOver; Insert Into [CASH BOOK] ([Date], [Desc], [Balance]) VALUES ('12/31/2011','Outstanding balance', @EndBal); RETURN




Reply With Quote
