i've got a temp table which contains the following
EventNum | StartDateTime | EndDateTime | SequenceID
------------------------------------------------------------
1 03/08/08 06/08/08 3074
2 05/08/08 08/08/08 3075
3 07/08/08 11/08/08 3076
4 09/08/08 Null 3077
Now in another table (lets call it Table2) i've got a start date which will fall between one of the dates in this table i.e. 06/08/08 will will between the startdatetime and endatetime of EventNum 2
as you can see the EndDateTime often overlaps the following StartDateTime indicating that the following entry was created before the previous one was closed, therefore this shows it belongs to the same collection.
If there were no consecutive overlapping entries then it would indicate a new collection.
what I'm trying to do is get the curent date out of 'Table2' and check to see if this belongs to CURRENT collection.
any sql gurus arround to lend a helping hand ?
Cheers
EventNum | StartDateTime | EndDateTime | SequenceID
------------------------------------------------------------
1 03/08/08 06/08/08 3074
2 05/08/08 08/08/08 3075
3 07/08/08 11/08/08 3076
4 09/08/08 Null 3077
Now in another table (lets call it Table2) i've got a start date which will fall between one of the dates in this table i.e. 06/08/08 will will between the startdatetime and endatetime of EventNum 2
as you can see the EndDateTime often overlaps the following StartDateTime indicating that the following entry was created before the previous one was closed, therefore this shows it belongs to the same collection.
If there were no consecutive overlapping entries then it would indicate a new collection.
what I'm trying to do is get the curent date out of 'Table2' and check to see if this belongs to CURRENT collection.
any sql gurus arround to lend a helping hand ?
Cheers