-
yks999 小试身手Lv3
发表于2023-3-22 11:35
悬赏10
已解决
楼主
select SUM(a.F_PREMONTHDEBITBALANCE) as D5,SUM(a.F_PREMONTHLOANBALANCE) as E5,SUM(a.F_MONTHDEBITAMT) as F5,SUM(a.F_MONTHLOANAMT) as G5,SUM(a.F_CURDATEDEBITBALANCE) as I5,SUM(a.F_CURDATEDEBITBALANCE) as J5
from dm_kjyw_tb_totalacct a left join TD_BOOKORG_INFO_WEI b
on (a.S_BOOKORGCODE=b.s_bookorgcode)
where a.D_ACCT IN (SELECT max(d_acct) d_acct FROM DM_KJYW_TB_TOTALACCT WHERE d_acct LIKE '<#=datetostr(@cwrq,yyyy-mm)#>%') AND ( NOT a.S_BOOKSBTCODE LIKE '6%') and a.S_BOOKSBTCODE not in ('172','272','302','303','320') and <#=if(@bookcode="","1=1","(" + ([] + @bookcode.value).select(true,if(@.level=0, "(b.s_ppbookorgcode = '" + left(@,12) + "')", if(@.level=1, "(b.s_ppbookorgcode = '" + left(@,12) + "' and b.s_pbookorgcode = '" + right(@,12) + "')", "(b.s_ppbookorgcode = '" + left(@,12) + "' and b.s_pbookorgcode = '" + mid(@,13,12) + "' and b.s_bookorgcode='" + right(@,12) + "')"))).join(" or ") + ")")#>
这段sql数据源的取值sql,去除前面或者后面的宏代码块后都不报错误,两个放一起就报错