会计科目余额表中同一科目出现多条记录现象如下:
问题描述:会计科目余额表中过滤本期,科目选择‘其他应收款’,勾选显示核算项目,点击确定。 查询出的报表中显示有部分客户显示两行数据,正确数据为这两行数据之和。
问题分析:这种情况的出现一般是由于核算项目横表中被凭证表,余额表引用的核算项目组合有重复记录
解决方法:
1、创建临时表t_itemdetail_error,把重复核算项目记录插入该表
select a.*, a.fdetailid Fdetailid_temp into t_itemdetail_error from t_itemdetail a join t_itemdetail b
on a.f1=b.f1 and a.fdetailcount=b.fdetailcount
where a.fdetailcount=1 and a.fdetailid<>b.fdetailid and a.f1>0 order by a.f1
2、在临时表t_itemdetail_error中修改错误的fdetailid值(以最小fdetailid值为基准):
update b set b.fdetailid_temp=a.fdetailid
from t_itemdetail_error a
join t_itemdetail_error b on a.f1=b.f1 and a.fdetailcount=b.fdetailcount
where a.fdetailcount=1 and a.fdetailid<b.fdetailid and a.f1>0 3、创建余额表临时表t_balance_temp :
select * into t_balance_temp from t_balance
order by fyear,fperiod,faccountid,fdetailid,fcurrencyid
4、更新余额表临时表的错误detailid值:
update a set a.fdetailid=b.fdetailid_temp from t_balance_temp a join t_itemdetail_error b on a.fdetailid=b.fdetailid
5、创建临时表temp002:
select top 0 * into temp002 from t_balance
南通金蝶软件 南通金蝶KIS专业版
free prescription cards
go cialis.com coupon
manufacturer coupons for prescription drugs
drug coupons free discount prescription card
memantine actavis
site memantine ramq
bimatoprost
open bimatoprost hair