Eddy,
In our company we have a lot of people working overnight. I have encountered a problem where transactions that go from day 1 into day 2 do not show up at all.

Code:
SELECT date_calendar.calendar_date, Hours.Hr, Trns.TransIdno
FROM date_calendar
CROSS JOIN (VALUES (0), (1), (2), (3), (4), (5), (6), (7), (8), (9), (10), (11), (12), (13), (14), (15), (16), (17), (18), (19), (20), (21), (22), (23)) AS Hours(Hr)
LEFT OUTER JOIN dbo.TRANSACTIONS Trns ON 
Trns.StartDate <= date_calendar.calendar_date AND (Trns.StopDate IS NULL OR Trns.StopDate >= date_calendar.calendar_date)
AND Trns.StartHr <= Hours.Hr AND (Trns.StopHr IS NULL OR Trns.StopHr >= Hours.Hr)
WHERE date_calendar.calendar_date >= '2019-03-09' AND date_calendar.calendar_date <= '2019-03-10'
My assumption is that a transaction that a transaction started on 03/09/19 at 22:00 going to 03/10/19 until 01:00 should be listed 4 times (At 22:00 | 23:00 | 00:00 | 01:00).
It is not showing up at all. Any suggestion where to start looking?