问题原因: |
对账没有任何问题,怀疑有多余数据出现在数据库。
跟踪以下脚本:
SELECT GL_accvouch.ccus_id AS iXM_id, GL_accvouch.ccode AS ienter_id,
GL_accvouch.dbill_date AS vdate, GL_accvouch.dt_date AS vdate1,
(CASE WHEN md > 0 THEN md ELSE 0 END - CASE WHEN mc < 0 THEN mc ELSE 0 END)
AS mmoney,
(CASE WHEN md_f > 0 THEN md_f ELSE 0 END - CASE WHEN mc_f < 0 THEN mc_f ELSE 0 END)
AS mmoney_f,
(CASE WHEN mc > 0 THEN mc ELSE 0 END - CASE WHEN md < 0 THEN md ELSE 0 END)
AS Fmoney,
(CASE WHEN mc_f > 0 THEN mc_f ELSE 0 END - CASE WHEN md_f < 0 THEN md_f ELSE 0 END)
AS Fmoney_f, iflagPerson
FROM GL_accvouch
WHERE ccus_id IS NOT NULL AND (iflag = 2 OR
iflag IS NULL) AND ibook = 1 AND NOT ibook IS NULL AND cCode LIKE '113101%' AND
dbill_date <= '2005-01-01'
ORDER BY GL_accvouch.ccus_id, GL_accvouch.ccode, GL_accvouch.dbill_date,
GL_accvouch.dt_date
原来年终结转后,以前年度的数据出现在GL_accvouch表中,并且会计期间为21的数据参与了运算,所以出错。
|