问题现象: | 库龄分析与存货核算出入库汇总表数量不一致 |
问题原因: | |
解决方案: | 您好, 此问题【经查看数据】现做如下分析与答复: 【问题原因】 由于数据无法还原,可以尝试如下方法进行测试 【解决方案】 查询某仓库某存货某批次某时间节点下期末结存数量为负的SQL语句 select sum(case when brdflag=1 then iquantity else -iquantity end),R2.cwhcode,R1.cinvcode,isnull(R1.cbatch,'') as cbatch from rdrecords R1 left join rdrecord R2 ON R2.ID=R1.ID --ID 收发记录主表标识 where (isnull(R2.bpufirst,0)=0 and isnull(R2.biafirst,0)=0 and isnull(R2.bIsSTQc,0)=0 and isnull(R2.bOMFirst,0)=0) or isnull(R2.bIsSTQc,0)=1 and R2.dDate <= '2011-05-31' --查询某时间节点 group by R2.cwhcode,R1.cInvCode,R1.cbatch having sum(case when brdflag=1 then iquantity else -iquantity end) <0 and cwhcode ='022' and cInvCode ='12040647' --查询某仓库某存货 |
相关补丁: | |
版本: | 8.71 |
模块: | 库存管理 |
产品: | 供应链 |
问题名称: | 库龄分析与存货核算出入库汇总表数量不一致 |
最后更新: | 2011-07-27 23:19:31 |