ValueState retrieval query 2: minimum time in state for a single tag
- Last UpdatedFeb 06, 2025
- 1 minute read
The following query finds the minimum time-in-state for the Mixer discrete tag for the "on" state. Note that minimum times are returned for each state for both the five-minute phantom cycle before the query start time and for the single retrieval cycle between 10:00 and 10:05.
SELECT DateTime, TagName, vValue, StateTime, wwStateCalc
FROM History
WHERE TagName IN ('Mixer')
AND DateTime >= '2017-12-11 08:00:00'
AND DateTime < '2017-12-12 08:00:00'
AND wwCycleCount= '1'
AND wwRetrievalMode = 'ValueState'
AND wwStateCalc = 'Min'
AND vValue = 1
The results are:
|
DateTime |
TagName |
vValue |
StateTime |
wwStateCalc |
|---|---|---|---|---|
|
2017-12-11 08:00:00.0000000 |
Mixer |
1 |
35906 |
Min |