资产负债表--据说是跟踪UFO报表得到的,我给魔改了一下,这么改可以用来做表
--资产负债表
SELECT gl_accsum.ccode,sum((CASE WHEN gl_accsum.cbegind_c<>N'贷' THEN gl_accsum.mb ELSE -gl_accsum.mb End)) as SumVal
FROM u8.UFDATA_账套文件夹.dbo.code INNER JOIN u8.UFDATA_账套文件夹.dbo.gl_accsum ON code.iYear = gl_accsum.iYear and code.ccode = gl_accsum.ccode and code.iYear=2021
WHERE gl_accsum.iYear=2021 and gl_accsum.iperiod=1 --and gl_accsum.ccode = N'1001'
group by gl_accsum.ccode