Re: Date range problem

"Prasanna shashikantrao patil" <[email protected]> Wed, 19 Mar 2003 14:43:33 +0530
Newsgroups gmane.comp.db.oracle.devel
Message-ID <LYRIS-1796914-918427-2003.03.19-09.08.53--gcdod-oracle#[email protected]>
hi,

select 'NO' from Vehicle_Booking
where Booking_From_Date <=3D 12-JAN-2003 -- to date
and Booking_To_Date >=3D 8-JAN-2003 -- from date

if this select throws no_data_found exception then the booking is =
possible.
if select returns any rows then booking is not possible.

Hope this helps you.
Regards,

-----Original Message-----
From: waseem altaf [mailto:[email protected]]
Sent: Tuesday, March 18, 2003 7:58 PM
To: Oracle
Subject: [oracle] Re: Date range problem


Hi=20

I have a table named "Vehicle_Booking" this table has two fields
"Booking_From_Date" and "Booking_To_Date" .

Scenario:
       If a vehicle is booked from 5-JAN-2003 To 10-JAN-2003 by an =
employee A . another employee B comes and want to book it=20
from 8-JAN-2003 to 12-JAN-2003.=20

I want to check whether the vehicle is already booked by some employee =
or not before assigning vehicle to employee B.
How can i do this.

Thanx in advance.



_____________________________________________________________
100% private, FREE email for life!
Visit http://inbox.com.pk

_____________________________________________________________
Select your own custom email address for FREE! Get [email protected] =
w/No Ads, 6MB, POP & more! =
http://www.everyone.net/selectmail?campaign=3Dtag


---
Change your mail options at http://p2p.wrox.com/manager.asp or=20
to unsubscribe send a blank email to %%email.unsub%%.

---
Change your mail options at http://p2p.wrox.com/manager.asp or 
to unsubscribe send a blank email to [email protected].