RadhaKrishnaKiJaya
asked on
Need help with a query
Hi Experts,
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(),'MMddyyy y') and
DATEDIFF(MINUTE, convert(varchar,StdTimeIn, 120),conve rt(varchar ,CURRENT_T IMESTAMP,1 20) < 2
and StdTimeIn IS NOT NULL and StdTimeout IS NULL)
Thanks in advance.
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(),'MMddyyy
DATEDIFF(MINUTE, convert(varchar,StdTimeIn,
and StdTimeIn IS NOT NULL and StdTimeout IS NULL)
Thanks in advance.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Curiosity overwhelms me why you would want to convert a date to a varchar in order to perform a math expression...
ASKER