AnsweredAssumed Answered

I would like to get a 15 minute average of 4 tags from the last year using PI-OLEDb from 1 second process data where the 4 tags are less than a specific value.

Question asked by ddnelson on Jan 5, 2017
Latest reply on Jan 5, 2017 by kduffy

I would like to get a 15 minute average of 4 tags from the last year using PI-OLEDb from 1 second process data where the 4 tags are less than a specific value.

 

However, the data in the archive is 1 second data and trying to do a query on more than about a month times out.

 

Here's the query:

select * from openquery(piserver,'select *

          from piarchive..piavg

        where tag = ''tag''

         and time between ''Jan 1 2016 12:00AM''

      and ''Jan  1 2017 12:00AM'' 

      and calcbasis = ''TIMEWEIGHTED''

      and timestep = ''00:15:00''

      and value < 10  ')

 

 

Is there a better, more efficient way to do this?

Outcomes