How to write script for employee multiple punch in

CREATE TABLE [dbo].[multiple](
[emp_code] [varchar](20) NULL,
[swip_in] [nvarchar](255) NULL,
[swipe_in_date] [nvarchar](255) NULL,
[swipe_out] [nvarchar](255) NULL,
[Swipe_out_date] [nvarchar](255) NULL
) ON [PRIMARY]


insert into multiple values ('H10004','04:48:34','08/12/2015','12:00:42','08/12/2015')
insert into multiple values ('H10004','14:36:30','08/12/2015','18:50:16','08/12/2015')
insert into multiple values ('H10005','05:50:08','08/12/2015','11:50:58','08/12/2015')
insert into multiple values ('H10005','14:48:06','08/12/2015','18:52:34','08/12/2015')
insert into multiple values ('H10005','20:22:56','08/12/2015','22:56:10','08/12/2015')
insert into multiple values ('H10009','05:45:44','08/12/2015','11:53:46','08/12/2015')
insert into multiple values ('H10009','14:52:52','08/12/2015','18:55:04','08/12/2015')
insert into multiple values ('H10013','05:57:32','08/12/2015','12:00:52','08/12/2015')
insert into multiple values ('H10013','14:46:44','08/12/2015','18:48:02','08/12/2015')


i want result like below 

Empcode swip_in1,   swip_out1,    swip_in2,   swip_out2,   swip_in3,   swip_out3

Condition :

1. 24 hrs who are multiple time punched 


August 20th, 2015 9:17am

Dear CelKo,

This is my user requirement , yes i agree your points and i am not experience in script , i am a SQL DBA and i have Microsoft SQL family so if i want any script i put here my family they provided lots of script so i will take that script and test from my side. 

Yes i forget to put the condition, after your comments only i am realize. but i am not joking this required by my users. 

My Condition is without 24 hrs who are multiple time punched that records only i want. here my friends are giving nice scripts so i am testing 

Thanks for your comments Mr. CELKO. 


Free Windows Admin Tool Kit Click here and download it now
August 22nd, 2015 4:32am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics