我有以下脚本返回格式化为美国的日期,我想将其转换为 GB 日期格式,它应该只返回日期部分。
SET DATEFIRST 1
select case @dateType
WHEN 'Daily' then i.overridedate
WHEN 'Weekly' then dateadd(day,-1*datepart(weekday,i.overridedate)+1,i.overridedate)
WHEN 'Monthly' THEN DATEADD(day, -1*DATEpart(day,i.overridedate)+1, i.overridedate)
WHEN 'Quarterly' THEN dateadd(mm,-3,DATEADD(qq, DATEDIFF(qq,0,i.overridedate )+1, 0)) END as 'date'