I want to check for the time difference between 2 times, if it is less than 2 min.
select StdLogID,StdTimeIn from LOGINDETAILS where userID = @UserID and TodaysDate =FORMAT(GetDate(),'MMddyyyy') and
DATEDIFF(MINUTE, convert(varchar,StdTimeIn,120),convert(varchar,CURRENT_TIMESTAMP,120) < 2
and StdTimeIn IS NOT NULL and StdTimeout IS NULL)
Thanks in advance.