AnsweredAssumed Answered

AF EF Starttime - SQL Query

Question asked by engineertdog on Mar 19, 2020

PI Vision just doesn't have the capabilities I need for reporting, and using the Web API wouldn't provide all the features I need either. So, I look to run an event driven structure off of PIFD using NodeJS. One of the aspects I need to do is read event frames for given time periods. The problem is that the starttime field in dbo.AFEventFrame is a bigint, and one I've never seen before. I'm not sure why this isn't datetime.

 

Example:

636974169830910034 should refer to 2019-06-29 10:56:23.091

 

In any case, I'm not sure how I can convert this timetamp to a datetime, or query the table using given datetimes. I've tried dateadd and using convert, but I've gotten the wrong result.

 

SELECT * FROM dbo.AFEventFrame
WHERE starttime < somedate AND starttime > somedate2 ;

Outcomes