Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<ol> <li><p>There are several problems with the "table" that make things difficult for you.</p> <ul> <li><p>what is the value of the missing punch ? how did you generate or default that for employees who punched in but did not punch out ? Null ? 23:59 ? DateTimeIn ? They are all incorrect but you must have some known value.)</p></li> <li><p>When you answer that, we can code the SQL (it really is an SQL question).</p></li> <li><p>what value would you like to update the missing Punch OUT time with:</p></li> <li><p>Next startime minus 5 mins</p></li> <li>where there is no next start time ? 17:00 ?<br> .</li> </ul></li> <li><p>AFA database design is concerned, and not having seen the other tables, the table should be as follows. Assuming they punch IN and OUT for each Project (job ?).<code><pre>CREATE TABLE Punch ( PunchID, -- No idea what use it has, but I will keep it anyway ProjectNo, EmployeeID, DateTime, IsStart BIT -- boolean, tinyint )</code></pre></p> <ul> <li><p>When the Punch IN happens, the Punch OUT has not happened, so any value you store for that is false.</p></li> <li><p>missing rows are easy to identify</p></li> </ul></li> <li><p>The front end, GUI, character-based command, whatever, could use a bit of improvement.</p> <ul> <li><p>it should explicitly punch IN or OUT</p></li> <li><p>when a Punch IN is registered, if there is no previous Punch OUT, then a series of default s could be used, and a Punch OUT created first. Eg same day: use the current datetime, next day: use 17:00 previous day.</p></li> </ul></li> </ol>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload