Chuck: I agree with Dennis McGrath, a cursor would be much easier. I broke the problem into 2 parts. First, combine the overlapping periods: 09:00 09:30 09:15 09:45 09:45 10:45 combine to 09:00 to 10:45 Without addressing this step:
Given that no overlaps occur, and that the sequence is ordered by time and numbered consecutively: select t1.EndTime, t2.startTime from Tbl t1, Tbl t2+ where t1.endTime < t2.StartTime and t1.RowCount = (t2.RowCount - 1) Gives a reasonable result. But then, I know you will also want to include the periods after the last time(presumably an appointment schedule) and before the end of business on the day. That is, fill in the unlisted times. That is where the cursor comes in. Jim Blackburn, Kodiak
