Hello,
I'm trying to create a view that displays events with start and end time. This view should be gathered from an existing table that only has an event time field and event type field.
So the current EventTable looks like this:
EventTime | BooleanField
------------------------------
1/1/2010 6:00AM 1
1/2/2010 6:00AM 0
1/3/2010 6:00AM 1
1/4/2010 6:00AM 1
1/5/2010 6:00AM 0
And the result set should look like this
StartTime | EndTime
-----------------------------
1/1/2010 6:00AM 1/2/2010 6:00AM
1/3/2010 6:00AM 1/5/2010 6:00AM
So the view should display the periods that the boolean field is true.
Is there a simple solution to achieve this in SQL Server 2008?
Thank you for help!