Hi,
after some trying i was able to get data from our PI Archive. We use PI (Osisoft) to archive our process data.
With the following query I got the data but the timestamp is not there:
SELECT t1.tag, t1.time, t1.value, t1.svalue,
t1.status, t1.flags
FROM picomp t1
WHERE ( ( ( t1.tag = 'AL2_Geschwindigkeit_Linienmotor_Formerstation' ) AND ( (t1.time >= ( '2017/03/05 1:47:16 PM' )) AND (t1.time <= ( '2017/03/05 2:44:40 PM' )) ) ) )
The column for the timestamp is just empty (numeric, continous).
Then I had the idea that the column for the timestamp is not numeric. I tried to convert the time into date with the follwoing query:
SELECT t1.tag, TO_Date(SUBSTR (time, 1, 15),'yyyymmdd') time, t1.value, t1.svalue,
t1.status, t1.flags
FROM picomp t1
WHERE ( ( ( t1.tag = 'AL2_Geschwindigkeit_Linienmotor_Formerstation' ) AND ( (t1.time >= ( '2017/03/05 1:47:16 PM' )) AND (t1.time <= ( '2017/03/05 2:44:40 PM' )) ) ) )
But there i got the error:
[PIODBC] [PIOLEDB] [SUBSTR] Overload resolution failed for (DateTime, Int16, Int16) arguments(s). [SQLSTATE=HY000]
What did I wrong?
Can anybody help me?