解决方案: |
原处理语句同样适用于此次提出的问题现象,故若调整数据,在以后可通过以下脚本进行,该脚本将75550问题中给出的解决方案泛化,将其中的日期替换为每次结算成本处理后的日期即可,如9月份可替换为“2005-9-30”等。 --更新rdrecords update rdrecords set facost=convert(decimal(20,4),iaprice/iquantity) from rdrecords join pursettlevouchs on rdrecords.autoid = pursettlevouchs.irdsid where psvid in (select psvid from pursettlevouch where dsvdate ='2005-8-31' ) --更新pursettlevouchs update a set isvacost=facost from pursettlevouchs a inner join rdrecords b on a.irdsid=b.autoid where psvid in (select psvid from pursettlevouch where dsvdate ='2005-8-31' ) |