T-SQL Azure Stream Analytics Rounding to Minute T-SQL Azure Stream Analytics Rounding to Minute azure azure

T-SQL Azure Stream Analytics Rounding to Minute


It should have auto cast the 0 from bigint to datetime, but there may be some quirks with the Azure version of T-SQL. Instead, use:

SELECT DATEADD(mi,   DATEDIFF(mi, CAST('1900-01-01 00:00:00.000' AS DateTime),     DATEADD(s, 30, MAX(timecreated))),  CAST('1900-01-01 00:00:00.000' AS DateTime)) as 'timestamp'