首页 > 其他 > 详细

列传行--统计考勤信息

时间:2021-09-07 07:11:20      阅读:29      评论:0      收藏:0      [点我收藏+]

insert into [dbo].[Attence] values(‘200718‘,‘2021-09-01‘,‘08:30‘,‘17:30‘)
insert into [dbo].[Attence] values(‘200718‘,‘2021-09-02‘,‘08:31‘,‘17:30‘)
insert into [dbo].[Attence] values(‘200718‘,‘2021-09-03‘,‘08:32‘,‘17:30‘)
insert into [dbo].[Attence] values(‘200718‘,‘2021-09-04‘,‘08:33‘,‘17:30‘)
insert into [dbo].[Attence] values(‘200718‘,‘2021-09-05‘,‘08:34‘,‘17:30‘)
insert into [dbo].[Attence] values(‘200888‘,‘2021-09-01‘,‘08:55‘,‘17:33‘)
insert into [dbo].[Attence] values(‘200888‘,‘2021-09-02‘,‘08:56‘,‘17:34‘)
insert into [dbo].[Attence] values(‘200888‘,‘2021-09-03‘,‘08:33‘,‘17:35‘)
insert into [dbo].[Attence] values(‘200888‘,‘2021-09-04‘,‘08:44‘,‘17:36‘)
insert into [dbo].[Attence] values(‘200888‘,‘2021-09-05‘,‘08:22‘,‘17:37‘)
select * from (
select Code,CreateDate,max(StartTime)+‘-‘+max(EndTime) as beginwork from Attence
where CreateDate>‘2021-08-25‘
group by code,CreateDate) t
PIVOT ( MAX([beginwork]) FOR [CreateDate] IN ([2021-09-01],[2021-09-02],[2021-09-03],[2021-09-04],[2021-09-05],[2021-09-06]) ) piv

 

列传行--统计考勤信息

原文:https://www.cnblogs.com/sportdog/p/15233472.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!