列传行--统计考勤信息

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

 

列传行--统计考勤信息

上一篇:vue+element UI 使用select元素动态的从后台获取到


下一篇:CF1530F Bingo