Results 1 to 3 of 3
  1. #1
    Master Klick is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Jul 2013
    Posts
    47

    Table populated based on date


    I'm building a small database to track rooms at an Inn. I have one table that tracks bookings which includes the room booked and the start and end date of the booking. I have another table that lists all the rooms. I would like one more table that either lists all the rooms that are currently booked, or one that lists all the rooms excluding those booked.

    This doesn't have to work well in a real life application, it just has to kind of work.

  2. #2
    ranman256's Avatar
    ranman256 is online now VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,524
    you already have this...
    the tRooms table will have the room ,etc data , and OccupiedBy
    Room, Occupied
    1, null
    2, 321
    3, null
    4, 77

    the client ID will appear in tRooms.OccupiedBy
    null means it is empty.

    make 2 queries:
    qsBookedRooms, select * from tRooms where Occupiedby is not null
    qsEmptyRooms, select * from tRooms where Occupiedby is null

  3. #3
    Master Klick is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Jul 2013
    Posts
    47
    Ok, but how do I make the OccupiedBy dynamic? I can get that to work for one instant, but I can't get it to make the room available again after the end date.

    I've never been able to get access to work in four dimensions.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 02-16-2015, 01:04 PM
  2. Replies: 3
    Last Post: 07-04-2014, 09:29 AM
  3. Replies: 11
    Last Post: 11-25-2013, 01:46 PM
  4. Replies: 9
    Last Post: 01-17-2013, 09:08 PM
  5. Replies: 4
    Last Post: 04-16-2012, 11:48 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums