Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: How to search between dates
This seems to work, give it a try:
SELECT equipid, a.enddate avail_from, min(b.startdate) avail_to
FROM test_date a, test_date b
WHERE a.equipid=b.equipid
AND a.enddate < b.startdate
GROUP BY a.enddate;
>I have table which will contain the reservation schedule of an
equipment
>in a lab. The table will look like below:
>
>UserID EquipID EquipName StartDate EndDate
>xyz 123 Name1 06/28/00 10/28/00
>abc 123 Name2 11/28/00 12/28/00
>efg 123 Name3 05/06/01
12/04/02
>
>
>So different users depending upon there needs will reserve the
>equipment.
>
>If i want to search for the availability of EquipID:123, and
specify a
>start date and end date. How should i parse through the above
table, to
>give search results about its avilability(i.e. it is avilable
from
>10/28/00 - 11/28/00 and again avialable form 12/28/00 - 05/06/00
and not
>in-between)
>
>
Got questions? Get answers over the phone at Keen.com.
Up to 100 minutes free!
http://www.keen.com
Received on Wed Jun 28 2000 - 00:00:00 CDT
![]() |
![]() |