Page tree
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

版本信息:9.85

问题原因:如何用快捷方法可以查到期初录入的库存商品数量与序列号数量不相符的商品?因为现在开账系统是逐条显示的,这样很慢。

处理方法:用下面语句去查询

SELECT i.PtypeId,i.Qty as 期初数量,b.XLH as 序列号个数,p.UserCode as 商品编码,p.FullName as 商品名称,s.FullName  as 仓库名称 from IniGoodsStocks i

left join (

select ptypeid,ktypeid,COUNT(*) XLH from gp_initPtypeSerial

group by ptypeid,ktypeid) b on i.PtypeId=b.PtypeID and i.KtypeId=b.KtypeID

left join ptype p on p.typeId=i.PtypeId

left join stock s on s.typeId=i.KtypeId

where i.Qty<>b.XLH


期初数量与序列号总数不一致:https://pan.baidu.com/s/1MYDhTnwVVmg7_5CUGdoqEg

  • No labels