Anonymous asked in Computers & InternetSoftware · 1 decade ago

microsoft access help?

I need help retrieving the number of rooms that have/had no bookings made in them.

I have the tables:

Room (RoomID)

Booking (BookingID, DateBookingMade, StartDate, EndDate, etc.)

Room_Booking (BookingID and RoomID)

I can get it so that I can get all the rooms with bookings made in them, but am not sure how to reverse it. I know it's a "is null" function, but it's just not working.

1 Answer

  • 1 decade ago
    Favorite Answer

    SELECT Room.RoomID

    FROM Room_Booking RIGHT JOIN Room ON Room_Booking.RoomID = Room.RoomID

    WHERE Room_Booking.RoomID Is Null;

    • Commenter avatarLogin to reply the answers
Still have questions? Get your answers by asking now.