Reading a value from history in a Query tag for a specific date and time

My error; I confused expression functions with SQL functions. The query that works is:

SELECT TAG
FROM TABLE
WHERE DATEPART(dy,t_stamp) = DATEPART(dy,(cast(GETDATE( ) -1 as date)))
AND DATEPART(hr,t_stamp) = 0

1 Like