Use no equality operators for comparison with cyclic retrieval and resolution
- Last UpdatedMar 19, 2025
- 1 minute read
If both ends of the time range are excluded (by using > and <), then a gap of resolution is left at the beginning and end of the result set.
The row(s) that equate to the start and end times are not returned.
This query uses a resolution of 1000, resulting in a 1 second resolution for the data.
SELECT DateTime, Value
FROM v_AnalogHistory
WHERE TagName = 'SysTimeSec'
AND wwResolution = 1000
AND DateTime > '2001-01-13 12:00:00'
AND DateTime < '2001-01-13 12:01:01'
The results are:
|
DateTime |
Value |
|---|---|
|
2001-01-13 12:00:01.000 |
1 |
|
2001-01-13 12:00:02.000 |
2 |
|
2001-01-13 12:00:03.000 |
3 |
|
2001-01-13 12:00:04.000 |
4 |
|
... |
|
|
2001-01-13 12:00:56.000 |
56 |
|
2001-01-13 12:00:57.000 |
57 |
|
2001-01-13 12:00:58.000 |
58 |
|
2001-01-13 12:00:59.000 |
59 |
|
2001-01-13 12:01:00.000 |
0 |
(60 row(s) affected)