User347430248 posted
Hi office_punch,
Instead of updating the value, I think you need to change your logic and you need to set the value for INOUT at insertion time.
Here, I assume that there is only two entries in table. One for IN and other for OUT.
At the time of insertion, You can check that whether there is any entry exist for this particular employ for today's date or not.
If there is no entry exist then you can insert the INOUT value as IN.
Same way, again check for the particular employee for today's date. If there is any entry exist then insert the new record with INOUT value as OUT.
You can use IF..ELSE in your query.
ELSE (IF...ELSE) (Transact-SQL)
IF...ELSE (Transact-SQL)
As per my understanding this is the suitable way to handle this issue.
Regards
Deepak