问题现象: | 例如,A存货在B仓库做过出入库,但是现在无现存量,在库存管理的现存量查询里还有记录,但现存量一栏显示为空,如何消除这条记录?另,后天数据库是哪个表存放该信息?系统中无A存货在B仓库的出入库单单据,但现存量查询中有记录,要证明给客户看,不是系统的问题! |
问题原因: | |
解决方案: | 您好, 根据您的网站描述和电话描述,此问题【经查看并测试演示帐套数据】现做如下分析与答复: 【问题原因】 该存货在该仓库中曾有出入库记录。 【解决方案】 在数据库后台执行以下语句,即可消除这些记录 declare @SUM_Q float set @SUM_Q = ( select sum(c1.iQuantity) from CurrentStock c1 left join rdrecords R1 on c1.cInvCode=R1.cInvCode left join rdrecord R2 ON R2.ID=R1.ID and c1.cWhCode=R2.cWhCode where c1.iSoType = 0 and c1.fOutQuantity=0 and c1.fInQuantity=0 and c1.fTransInQuantity=0 and c1.fTransOutQuantity=0 and c1.fPlanQuantity=0 and c1.fDisableQuantity=0 and c1.fAvaQuantity=0 and c1.fStopQuantity=0 and R1.cInvCode is null ) if @SUM_Q =0 print'数据有错误,不可执行此SQL语句,请检查用户数据' else delete CurrentStock select * from CurrentStock c1 left join rdrecords R1 on c1.cInvCode=R1.cInvCode left join rdrecord R2 ON R2.ID=R1.ID and c1.cWhCode=R2.cWhCode where c1.iSoType = 0 and c1.iQuantity=0 and c1.fOutQuantity=0 and c1.fInQuantity=0 and c1.fTransInQuantity=0 and c1.fTransOutQuantity=0 and c1.fPlanQuantity=0 and c1.fDisableQuantity=0 and c1.fAvaQuantity=0 and c1.fStopQuantity=0 and R1.cInvCode is null 【注意事项】修改前请务必做好数据备份;上面语句中可能有标点符号在复制粘贴时发生转变错误,请自行替换成英文半角符号 如有问题,敬请给我发送邮件! |
相关补丁: | |
版本: | 8.90 |
模块: | 库存管理 |
产品: | 供应链 |
问题名称: | 做过出入库单但无现存量的存货记录如何在现存量查询中消除记录? |
最后更新: | 2011-06-08 23:35:31 |