use the following Query
declare @tb table(id char,amount int,[date] date, total int)
insert into @tb(ID,amount,[Date],Total) values
('A',20,'March 5 2015',20),
('B',40,'Feb 21 2015',40),
('C',60,'Feb 2 2015',60)
declare @amt int=70
;with cte as (select *,ROW_NUMBER() over(order by [date] desc ) as rno from @tb t),
cte1(rno,tot) as (select top 1 rno, @amt-amount as tot from cte t
union all select t.rno, tot-amount as tot from cte t,cte1 where (t.rno-1)=cte1.rno
)
update t set total=(case when tot>0 then 0 else -tot end) from cte t inner join cte1 on t.rno=cte1.rno
select * from @tb