select isnull((select sum(FXsJine) from V_ST_NewMonthData t0 where exists(select 1 from V_ST_EmpCust t1 where t0.FCustID=t1.Fcustid and t1.Fywyid='145365')
and datediff(s,'2015-04-01 00:00:00',convert(varchar(20),t0.FYear)+'-'+convert(varchar(20),t0.FMonth)+'-1')>0 and datediff(s,dateadd(s,-1,dateadd(m,1,(convert(varchar(20),t0.FYear)+'-'+convert(varchar(20),t0.FMonth)+'-1'))),'2015-05-31 23:59:59')>=0 and t0.FDeptID=100046),0)
结果
无列名
1322047.4700000000
提示错
parse error. detail message is :
Error. additive operator can not use add Char Or NChar
source sql is :
select isnull((select sum(FXsJine) from V_ST_NewMonthData t0 where exists(select 1 from V_ST_EmpCust t1 where t0.FCustID=t1.Fcustid and t1.Fywyid='145365')
and datediff(s,'2015-04-01 00:00:00',convert(varchar(20),t0.FYear)+'-'+convert(varchar(20),t0.FMonth)+'-1')>0 and datediff(s,dateadd(s,-1,dateadd(m,1,(convert(varchar(20),t0.FYear)+'-'+convert(varchar(20),t0.FMonth)+'-1'))),'2015-05-31 23:59:59')>=0 and t0.FDeptID=100046),0)