So I have timestamp which I need to convert into time. So I have tried this
Convert From Bigint to datetime value
But it is not working in Azure Function App :/
Basically I have this code
SELECT
dateadd(s, convert(bigint, XEvent.[Timestamp]) / 1000, convert(datetime, '1-1-1970 00:00:00'))
FROM
TwoPartitionXEventHub
Edit 1
I get following error: Expression is not supported: 'convert ( bigint , XEvent . [Timestamp] )'.
Edit 2
I have tried like this too:
dateadd(s, SQL_BATCH_COMPLETED.[Timestamp]/1000,'1-1-1970 00:00:00')
But it returns unknown error
(https://msdn.microsoft.com/en-us/library/azure/dn834997.aspx)
Problem was that I was using timestamp that was ULONGLONG which is bigger than bigint. After converting that timestamp locally into SYSTEMTIME insted of FILETIME i did not need to convert anything in Azure it was already in datetime format.
Thanks!