Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Historian

Specifying the start date with ">="

  • Last UpdatedMar 19, 2025
  • 2 minute read

If the start date is specified using >= (greater than or equal to), then a row is always returned for the specified start date. If the start date/time coincides exactly with a valid value change, then the Quality is normal (0). Otherwise, the value at the start date is returned, and the Quality value is 133 (because the length of time that the tag's value was at X is unknown).

Query 1

For this query, the start date will not correspond to a data change:

SELECT DateTime, Value, Quality

FROM History

WHERE TagName = 'SysTimeMin'

AND wwRetrievalMode = 'Delta'

AND DateTime >= '2001-01-13 12:00:30'

AND DateTime < '2001-01-13 12:10:00'

The start time (12:00:30) does not correspond with an actual change in value, and is therefore marked with the initial quality of 133:

DateTime

Value

Quality

2001-01-13 12:00:30.000

0

133

2001-01-13 12:01:00.000

1

0

2001-01-13 12:02:00.000

2

0

2001-01-13 12:03:00.000

3

0

2001-01-13 12:04:00.000

4

0

2001-01-13 12:05:00.000

5

0

2001-01-13 12:06:00.000

6

0

2001-01-13 12:07:00.000

7

0

2001-01-13 12:08:00.000

8

0

2001-01-13 12:09:00.000

9

0

(10 row(s) affected)

Query 2

For this query, the start date will correspond to a data change:

SELECT DateTime, Value, Quality

FROM History

WHERE TagName = 'SysTimeMin'

AND wwRetrievalMode = 'Delta'

AND DateTime >= '2001-01-13 12:01:00'

AND DateTime < '2001-01-13 12:10:00'

The start time (12:01:00) does correspond exactly with an actual change in value, and is therefore marked with the normal quality of 0.

DateTime

Value

Quality

2001-01-13 12:01:00.000

1

0

2001-01-13 12:02:00.000

2

0

2001-01-13 12:03:00.000

3

0

2001-01-13 12:04:00.000

4

0

2001-01-13 12:05:00.000

5

0

2001-01-13 12:06:00.000

6

0

2001-01-13 12:07:00.000

7

0

2001-01-13 12:08:00.000

8

0

2001-01-13 12:09:00.000

9

0

(9 row(s) affected)

Query 3

For this query, the start date will return at least one row, even though the query captures no data changes:

SELECT DateTime, Value, Quality

FROM History

WHERE TagName = 'SysTimeMin'

AND wwRetrievalMode = 'Delta'

AND DateTime >= '2001-01-13 12:00:30'

AND DateTime < '2001-01-13 12:01:00'

The query does not capture an actual change in value, and is therefore marked with the initial value quality of 133 for the start time of the query:

DateTime

Value

Quality

2001-01-13 12:00:30.000

0

133

(1 row(s) affected)

TitleResults for “How to create a CRG?”Also Available in