Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Getting a list of times that are consective

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-02-25 : 11:02:59
Kirk writes "Table1

PK      reskey    resgrp   time    resused (0=NOT USED 1 = USED)
========================================
10 10 5 0730 1
11 10 5 0745 1
12 10 5 0800 0
13 10 5 0815 1
14 10 5 0830 1
15 10 5 0845 0
16 10 5 0900 1
17 10 5 0915 0
18 10 5 0930 0
19 10 5 0945 0
20 10 5 1000 0


I need to be able to query the table for a set of time slots
that equal some period (example 1 hour) for a given resgrp that
have not already been marked used. These time slots have to be
together. In the table listing above the result set should
just include records 17-20"
   

- Advertisement -