遇的问题

1、sql日期转换报错

 

 

select ProductionDate,DeptName,BranchCode, BranchName,WorkshopCode,WorkshopName,item,HaltName, SUM(HaltPeriod) AS HaltPeriod 
, case bz when 'A' then '' when 'B' then '' when 'C' THEN '' end as BZ from bus_gtd
where valid='1' and  DeptName='炼铁事业部' and convert(varchar(10),ProductionDate,120) ='${GtoDate}'
group by ProductionDate,DeptName,BranchCode,BranchName,WorkshopCode,WorkshopName,BZ,item,HaltName
ORDER BY BranchCode,WorkshopCode,bus_gtd.BZ

sql 里将日期型转成字符型

posted on 2020-11-26 09:25  michellexiaoqi  阅读(144)  评论(0编辑  收藏  举报