Free for PREMIUM members
Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium
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
The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.
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.
Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks