I need to display a count of 1 hour time blocks available from a block of time minus the duration of transactions scheduled within the block of time.
For example, a staff member has 2.5 hours blocked off (2:30pm to 5:00pm) as available time in the dbo.Schedule_Staff table. However, in the dbo.Trans table they have
a 2:30 to 3:00 transaction scheduled and a 4:30 to 5:00 transaction scheduled. So there is a 1 hour block of time still available within the 2:30 to 5:00 block.
I need a query that will count the number of available 1 hour blocks of time for each staff member within a specified date range. (>=getdate() and <= end date)
For example, a staff member has 2.5 hours blocked off (2:30pm to 5:00pm) as available time in the dbo.Schedule_Staff table. However, in the dbo.Trans table they have
a 2:30 to 3:00 transaction scheduled and a 4:30 to 5:00 transaction scheduled. So there is a 1 hour block of time still available within the 2:30 to 5:00 block.
I need a query that will count the number of available 1 hour blocks of time for each staff member within a specified date range. (>=getdate() and <= end date)