i have the punch in one completed my struggle is getting the punch out to find that record and save the production data on that row.
this is excel thinking, not database thinking.
each punch creates a record, as a minimum it stores the employeeID and the date/time. You will probably have other fields such as machine/line, production data, job number and 'direction' (in/out). table might look something like
PK.....EmpID….In/Out....JobNo...clockTime
1...….10...……..I...………..0...……..08:00
2...….12...……..I...………..0...……..08:01
3...….10...……..I...………..123...….08:10
4...….10...……..O...……….123...….08:15
5...….12...……..I...………..123...….08:16
6...….10...……..O...……….0...……..08:20
7...….10...……..I...………..0...……..08:25
This tells the story that employee10 started work at 8am, at 08:10 he starts on job 123 and finishes it at 8:15, at 8:20 he goes on a break returning at 08:25. In the meantime employee 12 arrived at work just after employee10 and sat around until 08:16 when he took over job 123 - and he's still working on it. You can use queries to determine how long the employee spent on a job, how long a job took across different employees, etc.
You may need more fields to indicate start/end of day, coffee break v lunch break etc. Perhaps also something that explains what they were doing between 8:15 and 8:20
You could change the above to have a intime and an outtime without the in/out flag which is what I think you are trying to achieve but I don't recommend it. I've built a number of time recording systems over the years and the above technique has much fewer issues overall.
However if you want to go your route then to find the relevant record the query would be something like
Code:
SELECT *
FROM tblTimes
WHERE EmpID=[Enter EmpID] and JobNo=[Enter JobNo] and outTime is null
The issue in both cases is ensuring that the employee 'does it right' - i.e. does not forget to clock in or out and does so at the appropriate time and not 2 hours later. Also checks to make sure they select the right job, and they don't have someone else clocking in or out on their behalf.