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