0

我是 Wonderware InSQL 历史学家的新手。我只检索一天的数据,每次递增几个值后,我都将值设置为零。

 0
 1
 2
 0
 1
 2
 3
 4
 5
 6
 7
 8
 0

在此处输入图像描述

我想计算值大于 0 的行数,目前我在查询中使用计数函数和 value>0 但我想使用,如果有任何 InSql 检索选项来计算值的数量..

select count(value) FROM *****.Runtime.dbo.History
            WHERE TagName = 'TagA'
            AND DateTime >= '2016-06-14 06:00:00'
            AND Value > 0

请帮我

4

1 回答 1

1

There are no retrieval mode in Wonderware Historian that can be used in a straightforward manner to solve your problem. Your proposed solution is probably the best one but be aware that it will display an incorrect value in case of a disconnection and reconnection scenario.

In case of a disconnection a NULL value will be logged and at reconnect the same value will be logged again (e.g. 0, 1, 2, NULL, 2, 3, 0, 1) resulting in the same value being counted twice.

于 2016-08-05T17:40:17.297 回答