select count(*) 数量 from fdjrb where code=2 /*and date between DATEFROMPARTS(YEAR('${date}'), MONTH('${date}'), 1) and '${date}'*/ --法定串休日 ${if(year(date)=year(getdate()) && month(date)=month(getdate())," and date between DATEFROMPARTS(YEAR('"+ date +"' + '-01'), MONTH('"+ date +"' + '-01'), 1) and '"+ date +"' + '-01' "," and date between DATEFROMPARTS(YEAR('"+ date +"' + '-01'), MONTH('"+ date +"' + '-01'), 1) and EOMONTH('"+ date +"' + '-01') ")} |