您的位置:首页 > 编程语言

KIS 专业版查询物料收发汇总表(或即时库存表)出现物料代码(或名称)完全相同的重复记录

2012-05-05 17:26 316 查看
第一,

常见的原因是核算项目物料是通过数据交换导入的,且存在多次导入操作,引起核算项目物料数据表中的记录存在不完整或重复记录。

第二,

一般可以按如下操作进行分析和解决:

1:检测存在重复的物料(如检查共4 条),SQL语句参考如下,

select count(*),fname,fnumber from t_icitem group by fname,fnumber having

count(*)>1

select * from t_icitem where fnumber in

('001.SA616153B4','001.SA616454A4','001.SA616644A4','001.SA616719A4')

2:查证重复物料记录没有库存业务发生,fitemid in (757,750,742,727)

select * from t_icitem where fnumber in

('001.SA616153B4','001.SA616454A4','001.SA616644A4','001.SA616719A4')

and fitemid not in (select fitemid from icstockbillentry)

--以及验证其他数据表,没有数据

select * from icbal where fitemid in (757,750,742,727)

select * from icinvbal where fitemid in (757,750,742,727)

select * from icinvinitial where fitemid in (757,750,742,727)

select * from icpurchaseentry where fitemid in (757,750,742,727)

select * from icsaleentry where fitemid in (757,750,742,727)

select fbillno,* from poorder where finterid in (

select finterid from poorderentry where fitemid in (757,750,742,727))

3:通过以上验证,各数据表都没有数据,并从物料表中直接删除

delete t_icitem where fitemid in (757,750,742,727)

4:通过以上步骤牏后,核对业务报表,数据正确。
本文出自 “金蝶软件技术服务” 博客,请务必保留此出处http://stkingdee.blog.51cto.com/4991988/853595
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: