Here is my table[![Biometric System Employee
I am using this SP But got an error message Only one expression can be specified in the select list when the subquery is not introduced with EXISTS. please anyone help me thank you.
IF(
(
SELECT(
SELECT * FROM AttendanceLogs
WHERE LogDateTime < CURRENT_TIMESTAMP
and LogDateTime > (
select CONVERT(datetime,CURRENT_TIMESTAMP)
)
)
%2)
=0)
begin
Update AttendanceLogs set Direction=1
end
else
begin
Update AttendanceLogs set Direction=0
end
I am creating an employee attendance system. Basically we have biometrics finger scanning device to track time and stored it to database but the device was not capable of storing time as checkout it could only be checkin as shown in 'Direction' column. Now I want to do is to change the Direction column from 1 to 0 If the employee 1 login at 7:27 Pm it should be recorded as '1' and when the same employee tries to login again at 7:28 Pm that same day, it should be recorded as '0'. it will be the basis to update the record