其他分享
首页 > 其他分享> > 遇的问题

遇的问题

作者:互联网

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 里将日期型转成字符型

标签:WorkshopCode,when,问题,ProductionDate,DeptName,BranchCode,BZ
来源: https://www.cnblogs.com/michellexiaoqi/p/14040580.html