How could i select the latest records by datetime of an SQL Server?
Here is the pseudo-code...
SELECT Records
FROM MyTable
WHERE current time >= (CurrentTime - 2 minutes)
Supposing the current Time is 10:25:39 pm
26/10/2009 10:25:39 pm
26/10/2009 10:25:00 pm
26/10/2009 10:24:53 pm
26/10/2009 10:24:19 pm
26/10/2009 10:23:58 pm
26/10/2009 10:14:56 pm
26/10/2009 10:12:56 pm
the SQL query should return these records...
26/10/2009 10:25:39 pm
26/10/2009 10:25:00 pm
26/10/2009 10:24:53 pm
26/10/2009 10:24:19 pm