Hi, I have a list of events that I want to filter on certain days and time of day. My events are in a table called events with event_start and event_end datetimes.
My proc goes something like this:
Say I have an event from 2008-11-21 23:15 to 2008-11-22 01:30 and another event from 2008-11-23 00:00 to 2008-11-23 00:30. The overlapping time is a total of 2 hours.
How do I go about to calculate this?
![[elephant2] [elephant2] [elephant2]](/data/assets/smilies/elephant2.gif)
graabein
My proc goes something like this:
Code:
create table #days (
from datetime,
to datetime)
insert #days (
from,
to
) values (
'2008-11-22 00:00',
'2008-11-22 06:00')
insert #days (
from,
to
) values (
'2008-11-23 00:00',
'2008-11-23 06:00')
--...
--drop table #days
Say I have an event from 2008-11-21 23:15 to 2008-11-22 01:30 and another event from 2008-11-23 00:00 to 2008-11-23 00:30. The overlapping time is a total of 2 hours.
How do I go about to calculate this?
![[elephant2] [elephant2] [elephant2]](/data/assets/smilies/elephant2.gif)
graabein