G
gouraud
Guest
My database consist three tables; Booking, Rooms and Customers.
Booking has
BookingID
CustomerID
RoomID
Arrival
Checkout
Rooms has
RoomID
RoomNum
Customers has
CustomerID
Lastname
Firstname
I have made queries based on this article: How to Query a Reservation Database by Date for Room Availability http://support.microsoft.com/?kbid=245074
I want to include customers Lastname,Firstname and RoomNum in the following query which returns a list of all the rooms that are already booked for given date.
PARAMETERS [Please enter arrival date] DateTime, [Please enter checkout
date] DateTime;
SELECT [Booking].[Room], [Booking].[Arrival], [Booking].[Checkout]
FROM Booking
WHERE ((([Booking].[Arrival]) Between [Please enter arrival date] And
[Please enter checkout date]-1))
Or ((([Checkout]-1) Between [Please enter arrival date] And [Please
enter checkout date]))
Or ((([Booking].[Arrival])<[Please enter arrival date]) And
(([Checkout]-1)>[Please enter checkout date]-1));
How do I do that?
Thanks
Booking has
BookingID
CustomerID
RoomID
Arrival
Checkout
Rooms has
RoomID
RoomNum
Customers has
CustomerID
Lastname
Firstname
I have made queries based on this article: How to Query a Reservation Database by Date for Room Availability http://support.microsoft.com/?kbid=245074
I want to include customers Lastname,Firstname and RoomNum in the following query which returns a list of all the rooms that are already booked for given date.
PARAMETERS [Please enter arrival date] DateTime, [Please enter checkout
date] DateTime;
SELECT [Booking].[Room], [Booking].[Arrival], [Booking].[Checkout]
FROM Booking
WHERE ((([Booking].[Arrival]) Between [Please enter arrival date] And
[Please enter checkout date]-1))
Or ((([Checkout]-1) Between [Please enter arrival date] And [Please
enter checkout date]))
Or ((([Booking].[Arrival])<[Please enter arrival date]) And
(([Checkout]-1)>[Please enter checkout date]-1));
How do I do that?
Thanks