解决方案: |
重新调整fa_total表中11月与12月的上月余额与累计折旧值即可.可以使用如下SQL语句使用前请先做好备份工作:
UPDATE fa11
set fa11.dblDeprTotal=fa11.dblDeprTotal+fa10.dblDeprTotal-fa11.dblMonthDeprTotal
from select * from fa_Total where iPeriod=10 as fa10
inner join fa_Total as fa11
on fa10.sDeptNum = fa11.sDeptNum and fa10.sTypeNum=fa11.sTypeNum
where fa11.iPeriod=11
UPDATE fa11
set fa11.dblMonthDeprTotal=fa10.dblDeprTotal
from select * from fa_Total where iPeriod=10 as fa10
inner join fa_Total as fa11
on fa10.sDeptNum = fa11.sDeptNum and fa10.sTypeNum=fa11.sTypeNum
where fa11.iPeriod=11
UPDATE fa12
set fa12.dblDeprTotal=fa12.dblDeprTotal+fa11.dblDeprTotal-fa12.dblMonthDeprTotal
from select * from fa_Total where iPeriod=11 as fa11
inner join fa_Total as fa12
on fa11.sDeptNum = fa12.sDeptNum and fa11.sTypeNum=fa12.sTypeNum
where fa12.iPeriod=12
UPDATE fa12
set fa12.dblMonthDeprTotal=fa11.dblDeprTotal
from select * from fa_Total where iPeriod=11 as fa11
inner join fa_Total as fa12
on fa11.sDeptNum = fa12.sDeptNum and fa11.sTypeNum=fa12.sTypeNum
where fa12.iPeriod=12 |