Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need SQL Help
Message
From
23/02/2001 13:49:20
Bob Lucas
The WordWare Agency
Alberta, Canada
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
00478577
Message ID:
00478980
Views:
41
Just to add a further note, you can calculate the number of intervals by replacing the cnt = 4 with a query such as this:
select (MAX(cnt)) from
 (select cnt = count(*)
  from onehour
   group by resgroup, respk, Substring(time, 1, 2)) as a
The basic logic I tried to use was

For each record in the table, how many records with that time or greater (within the one hour time frame) have the resused as false?
If that count is equal to the number of intervals in an hour then we have a starting time for which we have one hour of available time. Of course, the very next interval may also provide a one hour window as well.


>>> Do you always have the fifteen minute intervals?
>
>No. The records are built during a "midnight run" process and the time interval is based off how the resource is defined. It is in at least 5 minute intervals. The min time a resource is allowed to be scheduled is 5 minutes and the interval is incremented in 5 minute increments.
>
>Thanks for your thoughts
>
>Kirk
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform