SSVIP(提问者)select "建设" as 部门, COUNT(*) 需求数量 FROM (
select * from view_HZLHRS_TrainingNeeds as b
left join view_DiGuiDpartData as a on a.dpartId = b.tn_Depart
where tn_DocumentStatus in (1,2) AND
tn_CreateDate >=DATEADD(month, 0,convert(datetime,'${Year_Month}'+"-01")) AND tn_CreateDate< DATEADD(DAY,1,EOMONTH('${Year_Month}'+"-01"))
AND TopLevelDepartmentID = 3
) as T GROUP BY TopLevelDepartmentdpartName
要怎么改呀
华莉星宸 回复 SSVIP(提问者)参考这个格式改
${if(len(a)=0,"select '建设' as 部门, COUNT(*) 需求数量 FROM ( select * from view_HZLHRS_TrainingNeeds as b left join view_DiGuiDpartData as a on a.dpartId = b.tn_Depart where tn_DocumentStatus in (1,2) AND tn_CreateDate >=DATEADD(month, 0,convert(datetime,"+Year_Month+"-01)) AND tn_CreateDate< DATEADD(DAY,1,EOMONTH('"+Year_Month+"-01)) AND TopLevelDepartmentID = 3 ) as T GROUP BY TopLevelDepartmentdpartName",'')}
SSVIP(提问者) 回复 华莉星宸大佬,帮忙看一下上面的图2是啥问题呀
${if(Type == "已填报","
select '建设' as 部门, COUNT(*) 需求数量 FROM (
select * from view_HZLHRS_TrainingNeeds as b
left join view_DiGuiDpartData as a on a.dpartId = b.tn_Depart where tn_DocumentStatus in (1,2)
AND tn_CreateDate >=DATEADD(month, 0,convert(datetime,"+Year_Month+"-01))
AND tn_CreateDate< DATEADD(DAY,1,EOMONTH("+Year_Month+"-01))
AND TopLevelDepartmentID = 3
) as T GROUP BY TopLevelDepartmentdpartName
","")}
华莉星宸 回复 SSVIP(提问者)${if(Type == "已填报"," select '建设' as 部门, COUNT(*) 需求数量 FROM ( select * from view_HZLHRS_TrainingNeeds as b left join view_DiGuiDpartData as a on a.dpartId = b.tn_Depart where tn_DocumentStatus in (1,2) AND tn_CreateDate >=DATEADD(month, 0,convert(datetime,'"+Year_Month+"-01')) AND tn_CreateDate< DATEADD(DAY,1,EOMONTH('"+Year_Month+"-01')) AND TopLevelDepartmentID = 3 ) as T GROUP BY TopLevelDepartmentdpartName ","")}