I need to pull in the last 48 hours of data, however I only need 24 hours. The reason why I am pulling in more data than necessary is because I do not know what time this script is going to run and the [data].[table]
source might not have a full 24 hours. I need a full days data between these two specific times 00:00:00
and 23:59:59
.
For example: If today is 2022-04-25
, then I want to bring in data between 2022-04-24 00:00:00
2022-04-24 23:59:59
.
SELECT [ID],[Timestamp],[Value]
FROM [data].[table]
Where [Timestamp] >= DateAdd(day, -2, getdate())