I have this table with a column ScheduledTime which holds DateTime values; These are start time of 
3hr Tests.
The column looks something like this:

```
SELECT ScheduledTime from Schedule;

2012-03-16 16:34:36.000
2012-03-16 16:34:36.000
2012-03-16 16:34:36.000
2012-03-16 16:34:36.000
2012-03-16 16:34:36.000
2012-03-16 16:34:36.000
2012-03-16 16:34:36.000
2012-03-16 16:34:36.000
2012-03-20 09:14:48.000
2012-03-20 13:14:48.000
2012-03-20 17:14:48.000
2012-03-20 21:14:48.000
2012-04-14 17:13:19.000
2012-04-14 21:13:19.000
2012-04-15 01:13:19.000
2012-04-15 05:13:19.000
2012-04-15 09:13:19.000
2012-04-15 13:13:19.000
2012-04-15 17:13:19.000
2012-04-15 21:13:19.000
2012-04-16 01:13:19.000
2012-04-16 05:13:19.000
2012-04-16 13:13:19.000
2012-04-16 17:13:19.000
2012-04-17 01:13:19.000
2012-04-17 05:13:19.000
2012-04-17 13:13:19.000
2012-04-18 18:29:16.000
2012-04-19 15:48:12.000
2012-04-19 19:10:00.000
2012-04-19 23:47:00.000
2012-04-20 10:27:28.000
2012-04-20 17:27:00.000

```

The datetime values listed above are start times for 3hr tests. So I need to get the next available slot for a 3hr test. Best would be if it can be accomodated within the existing tests or currentTime+1hr.

The task is to generate a column (say SlotsColumn) which holds start time for 3hr slots obtained from the ScheduledTime column and the SlotsColumn value is > {fn Now()} i.e. CurrentTime.

Optional is that if it doesn't have any such value, it should give CurrentTime+1hr

Using SQL Server 2008.

```
I have tried this:  
WITH rows AS 
        (
        SELECT  *, ROW_NUMBER() OVER (ORDER BY [ScheduledTime] ) AS rn 
        FROM    [dbo].[Schedule]  
        WHERE [ScheduledTime] IS NOT NULL               
        ) 
SELECT  TOP(1)
DATEADD(second,10800, mc.ScheduledTime) AS NextTime 
FROM    rows mc 
JOIN    rows mp   
ON      mc.rn = mp.rn - 1   
WHERE (DATEDIFF(SECOND, mc.ScheduledTime, mp.ScheduledTime) - 10800) >= 10800 
order by mc.ScheduledTime DESC

```

The query returns list of one valid start time in the future, only if it exists. 

To the sample data above, it returns '2012-04-20 03:47:00.000' which is wrong as it doesn't consider that there is another test at '2012-04-20 17:27:00.000'. They should not overlap.
The desired output is: '2012-04-20 12:27:00.000' as, it is after the test at '2012-04-20 10:27:28.000' and before the test at '2012-04-20 17:27:00.000', so perfect slot for a 3hr test.
The CurrentTime for me is '2012-04-20 11:45:23.393'

How do I ensure that it returns CurrentTime+1hr if no such valid time exists?

It can be done in C#, but trying SQL Query.

Any help/hints please.