(FAQ)初始化时对账检查不平
金蝶云社区-金蝶云社区
金蝶云社区
0人赞赏了该文章 779次浏览 未经作者许可,禁止转载编辑于2015年03月02日 00:00:00
【问题】: (FAQ)初始化时对账检查不平
版本: 7.5
模块: 固定资产
【答复】:
系统反初始化过,考虑存在垃圾数据。 --查询初始化卡片数量 select count(*) from t_fa_famoncard where fcompanyid=(select fid from t_org_company where fnumber='公司编码') and ffaperiodid is null --查询curcard数量 select count(*) from t_Fa_facurcard where fcompanyid=(select fid from t_org_company where fnumber='公司编码') --查询余额表数量 select count(*) from t_fa_faaccountbalance where fcompanyorgunitid=(select fid from t_org_company where fnumber='公司编码') and fperiodid=(select fid from t_bd_period where fumber=初始化期间) 若存在curcard与余额表数量大于初始化卡片数量,则查询出来,删除。 --查询没有对应初始化卡片的curcard select * from t_fa_facurcard where fid not in (select ffacurcardid from t_Fa_famoncard where fcompanyid=(select fid from t_org_company where fnumber='公司编码') and ffaperiodid is null) --查出来后删除 --查询没有对应curcard的余额表 select * from t_Fa_faaccountbalance where ffacurcardid not in (select fid from t_fa_facurcard where fcompanyid=(select fid from t_org_company where fnumber='公司编码')) and fcompanyorgunitid=(select fid from t_org_company where fnumber='公司编码') and fperiodid=(select fid from t_bd_period where fumber=初始化期间) --查出来后删除