catronro

OLEDB Enterprise - Pulling Time into transposed snapshot

Discussion created by catronro on Jan 18, 2013
Latest reply on Jan 18, 2013 by catronro

I have created a transposedSnapshot in the PI SQL Commander. I have successfully created a query to return results of the TransposedSnapshot.

 

I am running into problems trying to get the time associated with the value in the snapshot. Basically I want to know the time the value was written to pi, so if the value was written at 01/18/2013 08:30:00...i want to see that in the result set. Here is what I have tried, but it only returns 1/1/1970 for all values.

 

SELECT eh.Name, eh.Path, s.Time, ts.[Time of Equipment], ts.[Longitude of Equipment], ts.[Latitude of Equipment], ts.[Heading of Equipment], ts.[Ground Speed of Equipment]
FROM  [Operations Reporting Ecosystem].[Asset].[Element] e
INNER JOIN  [Operations Reporting Ecosystem].[Asset].[ElementHierarchy] eh ON eh.ElementID = e.ID
INNER JOIN [Operations Reporting Ecosystem].[Data].[Snapshot] s ON s.ElementAttributeID = e.ID
CROSS APPLY [Operations Reporting Ecosystem].[DataT].[TransposeSnapshot_Haul_Truck_GPS] (e.ID) ts
OPTION (FORCE ORDER, EMBED ERRORS)

 

7827.snapshot.jpg

 

 

Outcomes