+-----+------------+----------+----------+----------+
| id | day | timein | timeout | total |
+-----+------------+----------+----------+----------+
| 007 | 2002-10-28 | 13:03:50 | 16:31:08 | 03:27:58 |
| 014 | 2002-10-28 | 12:21:22 | 17:04:12 | 00:00:00 |>>>
| 014 | 2002-10-28 | 08:23:30 | 11:58:49 | 03:35:19 |
| 013 | 2002-10-28 | 08:00:00 | 11:57:14 | 03:57:14 |
| 817 | 2002-10-28 | 08:00:00 | 16:48:17 | 08:48:17 |
| 011 | 2002-10-28 | 00:00:00 | 12:04:58 | 12:04:58 |
| 013 | 2002-10-28 | 11:57:37 | 15:05:36 | 00:00:00 |>>>
| 014 | 2002-10-29 | 08:23:20 | 00:00:00 | 00:00:00 |
| 531 | 2002-10-29 | 07:30:00 | 00:00:00 | 00:00:00 |
| 817 | 2002-10-29 | 08:00:00 | 00:00:00 | 00:00:00 |
| 011 | 2002-10-29 | 09:22:13 | 00:00:00 | 00:00:00 |
+-----+------------+----------+----------+----------+
11 rows in set (0.00 sec)
+---------+--------------------------+------+-----+----------+-------+
| Field | Type | Null | Key | Default | Extra |
+---------+--------------------------+------+-----+----------+-------+
| id | int(3) unsigned zerofill | | | 000 | |
| day | date | YES | | NULL | |
| timein | time | YES | | NULL | |
| timeout | time | YES | | NULL | |
| total | time | YES | | NULL | |
+---------+--------------------------+------+-----+----------+-------+
5 rows in set (0.01 sec)
For some reason or another the total isn't being set on ID 14's first entry and ID 13's second entry.
I have a timesheet set up for our employees where they punch in, it inserts a record with their id, the date and the current time.
Then it checks to see if there is a record for the current day without a timeout value, and produces a punchout button which updates the record with the current time in the timeout position and sets the total to timeout-timein.
When I do the update function:
UPDATE timesheet set total=timeout-timein where timeout!=NULL;
I get two warnings, presumably for these entries. When I try to manually set them, it shows a matched record and skips over them. (The rest of the entries accept the totals correctly)
Does anyone have any insight as to what could be occuring here?
-K