SELECT * FROM tblactivity where DATEDIFF(hour,checkintime,GETDATE()) <= 2
SELECT * FROM tblactivity WHERE checkintime BETWEEN DATE_SUB(NOW(), INTERVAL 2 HOUR)
select * from tblactivity where checkintime > DATEADD(HOUR, -2, GETDATE())
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)