I am making a system to book rooms but i am stuck with the availability check
I have a table with the cottage details in it(tblCottage)
and then one just for availability checks (tblAvail)
some code below
select * from tblCottage , tblAvail where tblCottage.intCottageid = tblAvail.intCottageid AND tblAvail.datbook = DATE '2007-11-18'
this brings back all bookings with that date but I dont know how to convert this in to checking all other combinations....
ie I know that room 204 is booked for that day so I want to list all the other rooms as available so the user can book them.
thanks for any help in advanced
2007-03-08
14:57:48
·
1 answers
·
asked by
Buda d
2
in
Computers & Internet
➔ Programming & Design
BTW I am using Oracle
and yes the date is stored in the tblAvail Table
one again thanks
2007-03-08
15:38:17 ·
update #1
The SQL code:
SELECT C.intCottageid FROM tblCottage C INNER JOIN tblAvail A ON C.intCottageid = A.intCottageID WHERE A.datbook != '2007-11-18'
will bring back all the other bookings in the database but how will that help me find out what rooms can be booked for that period?
i think i need to somehow get the data from the first query which shows which rooms are not available into another query to remove them from the choices. so if room 204 is listed in the first query then it is removed from the list of available rooms as a product of the last query.
2007-03-08
15:44:34 ·
update #2