Sorry for the premature send on the previous response.

> Is there an SQL way to return the empty slots:
> 13:00 13:30
> 14:30 15:00

SELECT End, MIN(t3.Start) +
  FROM YourTable t1, YourTable t3 +
  WHERE NOT EXISTS +
  (SELECT * FROM YourTable t2 WHERE t2.Start = t1.End) +
  AND t3.Start > t1.End +
  GROUP BY  End

Translated into "English Query Language" this says:

Select all the End times that are not also in the table as a Start time (the
NOT EXISTS part) and also give me the minimum Start time that is greater
than the selected End time.  The period from the "unstarted" end to the next
highest start time is a hole in the schedule.

--
Larry



_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

Reply via email to