简体   繁体   中英

SQL Server Historian Query Boolean Total Time

I am trying to query a wonderware historian to calculate total time a tag was reading True (or False) within a set period of time. I can't get the query to even give me values for the Boolean tag. I am not sure if I am using the wrong retrieval method, but even 'FULL' doesn't result in any results being returned. I know that there is data for that tag - the DCS software can trend historical values for that tag with a true/false line.

Is there something different with SQL server or T-SQL (which is what I think it uses) that you have to do to get boolean values?

Providing you have historian client installed, you can try this:

Use the Historian Client Query tool. Under "Query type", choose History values. Browse to your discrete tag. Choose retrieval mode "Full". You should be able to press "SQL" to see what query is used in order to retrieve these values.

If no values are showing, are you sure the tag value is actually changing in this time period? Is ForceStoragePeriod set too high for this tag?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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