employeeid BUSINESS_DATE clock_in_date_time clock_out_date_time
206 2015-03-09 00:00:00.000 2015-03-09 07:25:40.140 2015-03-09 12:00:26.687
206 2015-03-09 00:00:00.000 2015-03-09 13:00:00.000 2015-03-09 16:34:11.493
206 2015-03-10 00:00:00.000 2015-03-10 07:58:52.803 2015-03-10 12:00:47.793
206 2015-03-10 00:00:00.000 2015-03-10 12:59:36.843 2015-03-10 17:05:09.593
206 2015-03-11 00:00:00.000 2015-03-11 08:00:36.007 2015-03-11 12:09:56.753
206 2015-03-11 00:00:00.000 2015-03-11 13:00:00.113 2015-03-11 17:13:47.700
206 2015-03-12 00:00:00.000 2015-03-12 07:56:15.817 2015-03-12 13:00:03.440
206 2015-03-12 00:00:00.000 2015-03-12 13:53:05.850 2015-03-12 17:10:06.713
206 2015-03-14 00:00:00.000 2015-03-14 07:57:33.777 2015-03-14 11:59:56.490
206 2015-03-14 00:00:00.000 2015-03-14 13:00:34.667 2015-03-14 17:00:48.560
select employeeid
,business_date
,min(clock_in_date_time) clock_in_date_time
,max(clock_out_date_time) clock_out_date_time
from Payroll.PUERTORICOTIMECARDS
where EMPLOYEEID = 206
group by id, BUSINESS_DATE, EMPLOYEEID
select t1.employeeid, t1.clock_out_date_time, t2.clock_in_date_time
from
(
select employeeid
,business_date
,min(clock_in_date_time) clock_in_date_time
,max(clock_out_date_time) clock_out_date_time
from Payroll.PUERTORICOTIMECARDS
where EMPLOYEEID = 206
group by id, BUSINESS_DATE, EMPLOYEEID
) t1
join
(
select employeeid
,business_date
,min(clock_in_date_time) clock_in_date_time
,max(clock_out_date_time) clock_out_date_time
from Payroll.PUERTORICOTIMECARDS
where EMPLOYEEID = 206
group by BUSINESS_DATE, EMPLOYEEID
) t2
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE