Basis(提问者)这个是外层嵌套的sql:
,SUM(CASE WHEN datediff(day,replace(\'${过账日期}\',\'-\',\'\')+\'01\',fgzdate)>=0 AND datediff(day,DATEADD(M, DATEDIFF(m,0,replace(\'${过账日期}\',\'-\',\'\')+\'01\')+1,-1),fgzdate) <= 0 THEN FCENT END) AS THIS_MONTH --过账日期当月
Basis(提问者) 回复 Moki_min不是的,那个指的是时间区间,以下是对应当月的sql:
这个是外层嵌套的sql: ,SUM(CASE WHEN datediff(day,replace(\\\'${过账日期}\\\',\\\'-\\\',\\\'\\\')+\\\'01\\\',fgzdate)>=0 AND datediff(day,DATEADD(M, DATEDIFF(m,0,replace(\\\'${过账日期}\\\',\\\'-\\\',\\\'\\\')+\\\'01\\\')+1,-1),fgzdate) <= 0 THEN FCENT END) AS THIS_MONTH --过账日期当月