I have a scenario in which a schedule is recorded like the top table below. Notice the start and end times, the meeting length, and the fact that you could book more than 1 meeting (book factor) during the times slot. The second table is the result needed. I have it working using the dreaded cursor, but I know there's got to be a more elegant solutions. Surely someone else has run into something similar?
empID bookFactor mtgLen mtgStart mtgEnd
1 2 15 7/1/2015 8:00 7/1/2015 8:15
1 1 15 7/1/2015 10:00 7/1/2015 11:00
2 1 30 7/1/2015 10:00 7/1/2015 11:00
2 2 20 7/2/2015 9:00 7/2/2015 9:20
3 1 20 7/2/2015 10:00 7/1/2015 10:20
empID schedule
1 7/1/2015 8:00
1 7/1/2015 8:00
1 7/1/2015 10:00
1 7/1/2015 10:15
1 7/1/2015 10:30
1 7/1/2015 10:45
2 7/1/2015 10:00
2 7/1/2015 10:30
2 7/2/2015 9:00
3 7/2/2015 10:00