AnsweredAssumed Answered

Summer time offset problem - PI OLEDB Provider

Question asked by Alec_Karim on Apr 13, 2020
Latest reply on Apr 13, 2020 by TimCarmichael

Hi, I'm trying to get daily values for a machine for the whole shift 12 Hrs with the table PIINTERP2, I have a query that I'm working on and i noticed that since the summer time change (March 07) the time on PI when I do a query show up like this:

 

03/09/20203/9/2020 7:30:00 AM3/9/2020 7:30:00 PM
03/09/20203/8/2020 7:30:00 PM3/9/2020 7:30:00 AM
03/08/20203/8/2020 7:30:00 AM3/8/2020 7:30:00 PM
03/08/20203/7/2020 6:30:00 PM3/8/2020 7:30:00 AM
03/07/20203/7/2020 6:30:00 AM3/7/2020 6:30:00 PM
03/07/20203/6/2020 6:30:00 PM3/7/2020 6:30:00 AM

 

 

The Query I'm doing is this:

SELECT A.Tag, FORMAT(A.TIME, 'MM/dd/yyyy') as "Dates", Date('-720m', A.Time) as "Start", A.TIME as "End",
    A.VALUE as "Good_Parts", B.VALUE as "Bad_Parts", 
    C.VALUE as "State", 
    TimeEQ ( 'Tagname', Date('-720m', A.Time), A.TIME, 1 ) as "Run",
    TimeEQ ( 'Tagname', Date('-720m', A.Time), A.TIME, 2 ) as "Startup",
    TimeEQ ( 'Tagname', Date('-720m', A.Time), A.TIME, 3 ) as "Idle",
    TimeEQ ( 'Tagname', Date('-720m', A.Time), A.TIME, 4 ) as "Alarm",
    TimeEQ ( 'Tagname', Date('-720m', A.Time), A.TIME, 5 ) as "Cycle Stop",
    TimeEQ ( 'Tagname', Date('-720m', A.Time), A.TIME, 6 ) as "Manual"
FROM
    PIINTERP2 A INNER JOIN PIINTERP2 B
    ON B.TIME = A.TIME INNER JOIN PIINTERP2 C
    ON C.TIME = A.TIME
WHERE
    A.TAG = 'Tagname.PART.OK.AV'
    AND B.TAG = 'Tagname.PART.BAD.AV'
    AND C.TAG = 'Tagname.DTSMachineState'
    and A.time between '03/06/2020 06:30:00' and '03/12/2020 06:30:00'
    AND A.timestep = '12H'
ORDER BY A.TIME DESC

 

Is there any way I could retrieve the past year without having a time offset after the summer time change?

I know PI is trying to compensate the change but the problem is that the data is not the correct one with that offset

Outcomes