AnsweredAssumed Answered

Using PI OLEDB to run the TIMEEQ function, how do I format a tag.time value to be accepted by this function?

Question asked by TimothyBrehm on Mar 23, 2016
Latest reply on Mar 29, 2016 by TimothyBrehm

The basic format I'm using is:


     TimeEq ('Sinusoid', 'Snapshot.time - 30d', 'Snapshot.time', 0)


Since I suspected that the date math might be off, I also tried:

     TimeEq('Sinusoid', '*-30d', 'Snapshot.time',0) 

and that failed as well, giving an empty return.    

     TimeEq('Sinusoid', '*-30d', '*',0)

does return a value.


If I use the *, everything works as intended, it's only passing the time values from the select table in.  I've also tried wrapping those in Date, and RelDate calls, using quotes and not.


In the broader scope, I've got a set of tags that are sometimes returning values, and are sometimes 0 because the equipment is off.  I'm looking to find the average on (or non-zero) value by multiplying the value from piavg by 1/ (1- the % time the equipment was off).  I'm not entirely thrilled with this method, but it's what I've got.


I hope this question isn't completely trivial, I'm new to PI, and starting from the PI OLEDB side without real access to the actual PI server.