任何人都可以帮我解决这个SQL案例: 如果我的脚本的计算日是星期一到星期五的工作日,我想添加案例,我应该添加到我的脚本中?
SELECT *
FROM
(SELECT a.cid,
a.SUBMIT_DATE,
a.REQ_BY,
a.MITRA,
a.COSTUMER_TYPE,
a.COSTUMER_NAME,
a.ADDRESS,
a.DESC,
a.CREATED_DATE,
a.TICKET_STATUS,
CASE
WHEN datediff(CURDATE(), A.SUBMIT_DATE) > 3 THEN 'OVER_SLA'
ELSE 'CLEAR'
END AS 'STATUS_SOLVE'
FROM complaint a
LEFT JOIN handling b ON a.cid = b.cid)a
WHERE a.STATUS_SOLVE ='OVER_SLA'
AND a.ticket_status='INPROGRESS'
答案 0 :(得分:0)
如果日期为整数形式:
SELECT DATENAME( dw, DATEFROMPARTS( @Year, @Month, @Day ) )
表示字符串:
SELECT DATENAME( dw, CONVERT( date, CONCAT( @Day, '/' , @Month, '/', @Year ), 103 ) )