Table : ras_attrecord Field : Clock (date time)
Table : staff_shift Fields: startdate (datetime), enddate (datetime)
Scenario
In my table there are multiple records of Time In and Time out. In order to get the timein, it will depend on the staff shift. for example, my shift is 2013-11-05 09:00:00 and my first time in is 2013-11-05 08:54:00 and i time in again 2013-11-05 08:55:00. Next, my end shift is 2013-11-05 18:00:00 andI exit the office at 2013-11-05 17:00:00 and again I time out 2013-11-05- 17:01:00... there are multiple records
2013-11-05 08:54:00 - First Time In 2013-11-05 08:55:00 - Second Time In 2013-11-05 08:54:00 - First Time Out 2013-11-05 08:55:00 - Second Time Out
My problem is i need a mysql query to get the first time in and the first time out... sorry for my bad english.
Thanks in advance