解决方案: |
根据现象发现,数据不对的仓库,红字红冲单的单价都是对的,蓝字红冲单的单价都为零。
写脚本调整出错的数据。
declare @id int
declare @cost float
declare @cs float
use ufdata_201_2006
select @cs=0
declare tiaozheng cursor
for select iInCost,id from ia_subsidiary where cVouType in ('24') cwhcode not in ('008','100','101','102','103')
open tiaozheng
fetch next from tiaozheng into @cost ,@id
while (@@fetch_status=0)
begin
update ia_subsidiary set iInCost= @cost,iAInPrice=iInCost*iAInQuantity where id=@id and cVouType in ('30') and cwhcode not in ('008','100','101','102','103')
select @cs =@cs+1
fetch next from tiaozheng into @cost ,@id
end
close tiaozheng
deallocate tiaozheng
select @cs |