想要用sql server 语句解决,周报是每周三上午8点到下周三的上午8点,就是将原日期空间的周改成周三8点到下周三8点,求解决
1条回答 默认 最新
关注这次不分月了?
with t as ( select '2022-03-24 08:55:00' d union all select '2022-03-24 07:55:00' union all select '2022-03-23 08:55:00' union all select '2022-03-23 07:55:00' union all select '2022-03-22 08:55:00' union all select '2022-03-22 07:55:00' union all select '2022-03-21 08:55:00' union all select '2022-03-21 07:55:00' union all select '2022-03-17 08:55:00' union all select '2022-03-17 07:55:00' union all select '2022-03-16 08:55:00' union all select '2022-03-16 07:55:00' union all select '2022-03-15 08:55:00' union all select '2022-03-15 07:55:00' ) select d,datename(weekday,d), cast( datepart(week,DATEADD(HOUR,88,d)) as VARCHAR) from t
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决评论 打赏 举报无用 1