You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my SQL statement I am converting a DATETIME column to UTC, then converting it to a UNIX timestamp, casting it to a BIGINT and multiplying by 1000. The result for "x" that I get is a string instead of a number. The Temperature column is being converted to a float like it should.
query: "SELECT TempId AS id, Temperature AS y, CAST(DATEDIFF(SECOND,{d '1970-01-01'}, DATEADD(SECOND, DATEDIFF(SECOND, GETDATE(), GETUTCDATE()), Recorded)) AS BIGINT) * 1000 AS x " + 'FROM templog ' + 'WHERE Recorded >= DATEADD(MINUTE, DATEPART(tzoffset, sysdatetimeoffset()), @startDate) ' + 'AND Recorded <= DATEADD(MINUTE, DATEPART(tzoffset, sysdatetimeoffset()), @endDate) ' + 'ORDER BY Recorded ASC'
{"id":70437,"y":68,"x":"1460467802000"}
The text was updated successfully, but these errors were encountered:
In my SQL statement I am converting a DATETIME column to UTC, then converting it to a UNIX timestamp, casting it to a BIGINT and multiplying by 1000. The result for "x" that I get is a string instead of a number. The Temperature column is being converted to a float like it should.
query: "SELECT TempId AS id, Temperature AS y, CAST(DATEDIFF(SECOND,{d '1970-01-01'}, DATEADD(SECOND, DATEDIFF(SECOND, GETDATE(), GETUTCDATE()), Recorded)) AS BIGINT) * 1000 AS x " + 'FROM templog ' + 'WHERE Recorded >= DATEADD(MINUTE, DATEPART(tzoffset, sysdatetimeoffset()), @startDate) ' + 'AND Recorded <= DATEADD(MINUTE, DATEPART(tzoffset, sysdatetimeoffset()), @endDate) ' + 'ORDER BY Recorded ASC'
{"id":70437,"y":68,"x":"1460467802000"}
The text was updated successfully, but these errors were encountered: