I have a table called slots with identity (id).
ID Employee Times Available
1 Anna 1900-01-01 07:00:00.000 0
2 Anna 1900-01-01 07:15:00.000 0
3 Anna 1900-01-01 07:30:00.000 1
4 Anna 1900-01-01 07:45:00.000 1
5 Anna 1900-01-01 08:00:00.000 1
6 Anna 1900-01-01 08:15:00.000 0
7 Charley 1900-01-01 07:00:00.000 0
8 Charley 1900-01-01 07:15:00.000 1
9 Charley 1900-01-01 07:30:00.000 1
10 Charley 1900-01-01 07:45:00.000 1
11 Charley 1900-01-01 08:00:00.000 0
12 Charley 1900-01-01 08:15:00.000 0
13 Charley 1900-01-01 08:30:00.000 0
14 Charley 1900-01-01 08:45:00.000 1
15 Charley 1900-01-01 09:00:00.000 0
and I need to get the time periods that each Employee has Available = 1
Anna 1900-01-01 07:30:00.000 1900-01-01 08:00:00.000
Charley 1900-01-01 07:15:00.000 1900-01-01 07:45:00.000
Charley 1900-01-01 08:45:00.000 1900-01-01 08:45:00.000
I did find some help here but for the life of me, I cannot make it work