I need to calculate the number of \"active minutes\" for an event within a database. The start-time is well known.
The complication is that these active minutes sho
Globally, you'd need:
(Note that this assumes the event can last multiple days: is that really likely?)
A different method would be to have a ticking clock inside the event, which checks every time whether the event should be counted at that time, and increments (in seconds or minutes) every time it discovers itself to be active during the relevant period. This would still require the helper table and would be less auditable (presumably).