Compare two date intervals
609007Nov 16 2007 — edited Nov 16 2007Forgive me for being a bit of a newbie, Im primarily a java guy and just learning pl/sql so bear with me.
Im trying to compare two date intervals to see if they overlap at all,
the start and end date of the first interval is stored in two date fields in my database and the other two dates will be input from a form
ex. check to see if 10-NOV-07 - 15-NOV-07 overlaps 12-NOV-07 - 18-NOV-07
for instance to see if a particular rental property is available for rental or if it is already booked
this seems like it should be easy enough to do, but I just can't seem to get my logic to work. can this be done strictly in the query or will I need to use an explicit cursor to grab the date info and then try to compare it?
I am running Oracle 10g and using Forms Builder for the forms