Experts Exchange connects you with the people and services you need so you can get back to work.
with TheData as (
select F.*, DD.Date, DT.Time, DD.Date + DT.Time as FullDatetime
from FactTransactions F
inner join S862.DimDate DD on DD.DateID = F.DateID
inner join S862.DimTime DT on DT.TimeID = F.TimeID
select * from TheData
where FullDatetime between DATEADD(hour, -4, GETDATE()) and GETDATE()
Open in new window
Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.
That query works when the time is 4AM or later. I needs to be modified to handle the rows from late yesterday with the current time is before 4AM.
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment
From novice to tech pro — start learning today.
Premium members can enroll in this course at no extra cost.