SQL query syntax help on time comparison from text string
Posted on 2011-10-06
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:
This should NOT be selected:
The SQL query syntax needs to work in both MS Access and SQL Server
Thanks in advance!