Experts,
What SQL query syntax should I use to retrieve all records where the processed time is within two minutes? There's a twist: my processed time field is a text field in this format YYYYMMDDHHNNSS (e.g. 20111006114320). I need to select all records where the process time is within two minutes of a specific.
For example, if the current process time is 11:43:20 (20111006114320), then records with these time value should be selected:
11:43:20
11:43:19
11:43:18
This should NOT be selected:
11:43:17
11:43:21
The SQL query syntax needs to work in both MS Access and SQL Server
Thanks in advance!
sew
abs(datediff(minute, date1, date2)) <= 2
to find the interval