简体   繁体   English

Wonderware Historian 查询中的某些日期时间过滤器不返回数据

[英]Some datetime filters on Wonderware Historian queries returns no data

I'm querying to Wonderware Historian Database from S QL Server Management Studio and found that sometimes I don't get values, depending on the datetime filters I've set, even using Full retrieval mode.我正在从SQL Server Management Studio查询Wonderware Historian 数据库,发现有时我没有得到值,这取决于我设置的日期时间过滤器,即使使用完全检索模式也是如此。

I can get the values for the first ten days of October with this statement:我可以通过以下语句获取 10 月前十天的值:

SELECT *
FROM   Runtime.dbo.History
WHERE  TagName = 'SFRL_JP\QInst' 
  AND  wwRetrievalMode = 'Full' 
  AND  wwQualityRule = 'Extended' 
  AND  wwVersion = 'Latest' 
  AND  DateTime >= '20191001 00:00:00'
  AND  DateTime <= '20191101 00:00:00';

But if I change de start date to October 2 (or any day after) the query only returns a tupla with value 0:但是,如果我将开始日期更改为 10 月 2 日(或之后的任何一天),则查询仅返回值为 0 的图普拉:

SELECT *
FROM   Runtime.dbo.History
WHERE  TagName = 'SFRL_JP\QInst' 
  AND  wwRetrievalMode = 'Full' 
  AND  wwQualityRule = 'Extended' 
  AND  wwVersion = 'Latest' 
  AND  DateTime >= '20191002 00:00:00'
  AND  DateTime <= '20191101 00:00:00';

Get same results using Historian Query and Historian Trends .使用Historian QueryHistorian Trends获得相同的结果。

All returned data with the first statement seems to be good ( QualityDetail = 192 and OPCQuality = 192 ).第一条语句返回的所有数据似乎都很好( QualityDetail = 192OPCQuality = 192 )。

I can't see what's wrong in the second query.我看不出第二个查询有什么问题。

It looks like the latest.dat files get corrupted over a period of time, so I've tried to export the existing data for those dates in .csv file, and then upload this new set of CSV files specifying "Original Values" instead of "Update Values" and process them via FastLoad for that specific tag and check the values.看起来 latest.dat 文件在一段时间内已损坏,因此我尝试将这些日期的现有数据导出到 .csv 文件中,然后上传这组新的 CSV 文件,指定“原始值”而不是“更新值”并通过 FastLoad 为该特定标签处理它们并检查值。 Queries seems to be ok, but after a couple of days same error appears again.查询似乎没问题,但几天后再次出现相同的错误。

Finally, solution comes from installing a patch on Historian: Wonderware Historian 11.6 SP1 P02 .最后,解决方案来自于在 Historian 上安装补丁: Wonderware Historian 11.6 SP1 P02

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM