based on your title(update a table)..you can do this using update trigger on table1..

create trigger updatedata
on dbo.table1
after update as
begin
if (update(status)) and exists(select * from inserted where status='approved')
Begin
update t2
set t2.totaldetention=t2.totaldetention-datediff(day,i.startddate,i.enddate)
from table2 t2
join
inserted i
on i.id=t2.id and i.status='approved'
end
end