E
Ellada
Hello,
I am building a hotel reservation system. For this query there are two
tables which i used "tblRoom" and "tblReservation".
The query below [qryRoomsReserved] shows me the rooms which are reserved
betweeen two dates:
PARAMETERS [Please enter arrival date] DateTime, [Please enter checkout
date] DateTime;
SELECT tblReservation.[Room No], tblReservation.[Booked From],
tblReservation.[Booked Until], tblRoom.[Room Type]
FROM tblRoom INNER JOIN tblReservation ON tblRoom.[Room No] =
tblReservation.[Room No]
WHERE (((tblReservation.[Booked From]) Between [Please enter arrival
date] And [Please enter checkout date]-1)) OR ((([Booked Until]-1) Between
[Please enter arrival date] And [Please enter checkout date])) OR
(((tblReservation.[Booked From])<[Please enter arrival date]) AND (([Booked
Until]-1)> [Please enter checkout date]-1));
The above works fine. BUT I want a query which will show me the rooms which
are avaliable (not reserved) between two dates. So, basically the inverse of
the above. Here's the problem.
I have tried the following to inverse the above query but with no luck:
SELECT tblRoom.[Room No]
FROM tblRoom LEFT JOIN qryRoomsReserved ON tblRoom.[Room No] =
qryRoomsReserved.[Room No]
WHERE ((([qryRoomsReserved].[Room]) Is Null));
Can anyone see the problem ?? Would be grateful for your knowledge.
Please tell me if u need more information about tables or anything else.
Nick.
I am building a hotel reservation system. For this query there are two
tables which i used "tblRoom" and "tblReservation".
The query below [qryRoomsReserved] shows me the rooms which are reserved
betweeen two dates:
PARAMETERS [Please enter arrival date] DateTime, [Please enter checkout
date] DateTime;
SELECT tblReservation.[Room No], tblReservation.[Booked From],
tblReservation.[Booked Until], tblRoom.[Room Type]
FROM tblRoom INNER JOIN tblReservation ON tblRoom.[Room No] =
tblReservation.[Room No]
WHERE (((tblReservation.[Booked From]) Between [Please enter arrival
date] And [Please enter checkout date]-1)) OR ((([Booked Until]-1) Between
[Please enter arrival date] And [Please enter checkout date])) OR
(((tblReservation.[Booked From])<[Please enter arrival date]) AND (([Booked
Until]-1)> [Please enter checkout date]-1));
The above works fine. BUT I want a query which will show me the rooms which
are avaliable (not reserved) between two dates. So, basically the inverse of
the above. Here's the problem.
I have tried the following to inverse the above query but with no luck:
SELECT tblRoom.[Room No]
FROM tblRoom LEFT JOIN qryRoomsReserved ON tblRoom.[Room No] =
qryRoomsReserved.[Room No]
WHERE ((([qryRoomsReserved].[Room]) Is Null));
Can anyone see the problem ?? Would be grateful for your knowledge.
Please tell me if u need more information about tables or anything else.
Nick.