SQL obtiene los últimos 5 minutos de datos
-- for last 5 mins
SELECT *
FROM table_name
WHERE (SELECT CONVERT(char(5),SYSDATETIMEOFFSET() AT TIME ZONE 'Central Standard Time', 108))
BETWEEN CONVERT(VARCHAR(5),CreationDate,108) AND CONVERT(VARCHAR(5), DATEADD(mi, 5,CreationDate),108)
-- for last 15 mins
SELECT *
FROM table_name
WHERE (SELECT CONVERT(char(5),SYSDATETIMEOFFSET() AT TIME ZONE 'Central Standard Time', 108))
BETWEEN CONVERT(VARCHAR(5),CreationDate,108) AND CONVERT(VARCHAR(5), DATEADD(mi, 15,CreationDate),108)
Tiny Coders