RE: How to search between dates

From: Pedro <agumersl_at_teleline.es>
Date: 2000/07/03
Message-ID: <vNW75.12994$Bg2.69091_at_telenews.teleline.es>#1/1


Pedro <agumersl_at_teleline.es> escribió en el mensaje de noticias NOD65.2968$Bg2.8929_at_telenews.teleline.es...
> Hi,
>
> I think you must develop a stored procedure that creates a cursor for
> iterate along the records and calculate the availability between dates.
> it's something like:
>
> declare
> v_DateBefore DATE := NULL;
> Cursor c_CursorName is Select * from table;
> begin
> for v_CursorVariableName in c_CursorName loop
> if v_DateBefore <> NULL then
> v_Daysavailable := v_CursorVariableName.EndDate -
 v_DateBefore;
> -- your code here
> -- ...........
> -- ...........
> end if;
> v_DateBefore := v_CursorVariableName.StartDate;

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ Sorry, this line is wrong. try this

          v_DateBefore := v_CursorVariableName.EndDate; ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡

> end loop;
> end;
>
> I hope this help you.
> Bye.
> Pedro Rubio
>
>
> Arun Solleti <asolleti_at_csee.usf.edu> escribió en el mensaje de noticias
> 395A8C35.B0B55893_at_csee.usf.edu...
> > Hi
> >
> > Can this be done ?
> >
> > 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)
> >
> > Thanks
> > Arun
> >
>
>
Received on Mon Jul 03 2000 - 00:00:00 CEST

Original text of this message