Please help me in implementing an attendance logic...
My problem is that whenever an employee logs in or will just take a break or have lunch outside, they will only use login to in doing it. Logout will only be use when an employee is finished his required number of hours.
Conditions are the following:
1. Transfer the first login of the day and first/last logout of the day or the first logout next day.
2. Flexible Time - Render 9hrs or record the last logout.
I just want to transfer the all the logs from Table 1 to Table 2...
From AttendanceLog
Date EmpID TransactionType DateTime
11/11/2008 1 IN 11/11/2008 8:00 AM // IN
11/11/2008 3 IN 11/11/2008 8:15 AM // IN
11/11/2008 2 IN 11/11/2008 8:30 AM // IN
11/11/2008 1 IN 11/11/2008 10:00 AM // Break
11/11/2008 1 IN 11/11/2008 12:01 PM // Lunch Break
11/11/2008 2 IN 11/11/2008 12:15 PM // Lunch Break
11/11/2008 3 IN 11/11/2008 1:30 PM // Lunch Break
11/11/2008 3 OUT 11/11/2008 5:30 PM // OUT
11/11/2008 4 IN 11/11/2008 5:35 PM // Night Shift
11/11/2008 1 OUT 11/11/2008 5:36 PM // OUT
11/11/2008 2 OUT 11/11/2008 5:38 PM //OUT
11/12/2008 4 OUT 11/12/2008 3:15 PM // OUT
TO Attendance
Date EmpID DateTimeIN DateTimeOut
11/11/2008 1 11/11/2008 8:00 AM 11/11/2008 5:36 PM
11/11/2008 2 11/11/2008 8:30 AM 11/11/2008 5:38 PM
11/11/2008 3 11/11/2008 8:15 AM 11/11/2008 5:30 PM
11/12/2008 4 11/11/2008 5:35 PM 11/12/2008 3:15 PM
Hope you would help me to implement this... I'm not good in sql