發(fā)布于:2018-02-14 18:55:22
問題現(xiàn)象:1、存貨材料出庫(kù)單列表和出庫(kù)匯總不平,其中齊選的數(shù)據(jù)差一分錢,全部的查詢差3分錢. 2:有一些存貨在存貨的暫估余額表中結(jié)存數(shù)量為0,金額不為0
解決方案:1、如果仍想對(duì)上,可以用下面的語(yǔ)句根據(jù)存貨明細(xì)帳更改一下單據(jù)上的計(jì)劃金額 update a set ipprice=iaoutprice from ia_subsidiary b inner join rdrecords a on b.id=a.autoid where dvoudate>='2005-5-1' and cvoutype='11' and isnull(iaoutprice,0)<>isnull(ipprice,0) 問題2:可以使用下面語(yǔ)句進(jìn)行更改: update b set facost=ipunitcost from rdrecord a inner join rdrecords b on a.id=b.id where cvouchtype='01' and facost is null and caccounter is not null update a set isvacost=facost,isvaprice=convert(decimal(20,2),isvquantity*facost) from pursettlevouchs a inner join rdrecords b on a.irdsid=b.autoid where isnull(facost,0)<>isnull(isvacost,0) and facost is not null and isvquantity<>0 update b set facost=isnull(iaprice/iquantity,0) from rdrecord a inner join rdrecords b on a.id=b.id where cvouchtype='01' and caccounter is not null and isnull(iaprice/iquantity,0)-isnull(facost,0)>0.01 and facost is not null