Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Returned BIGINT Being Cast To String #44

Open
jason-bean opened this issue Apr 13, 2016 · 0 comments
Open

Returned BIGINT Being Cast To String #44

jason-bean opened this issue Apr 13, 2016 · 0 comments

Comments

@jason-bean
Copy link

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"}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant