468,238 Members | 1,712 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,238 developers. It's quick & easy.

Logic problem in for attendance IN/OUT

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
Nov 10 '08 #1
0 1602

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by Richard Williamson | last post: by
reply views Thread by kermitthefrogpy | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.