Results 1 to 2 of 2
  1. #1
    Nils is offline Novice
    Windows Vista Access 2010 32bit
    Join Date
    Feb 2011
    Posts
    1

    Track capacity changes month by month

    Hi guys,



    I have a list of hotels that include their capacity (the number of hotelrooms they have), specified on a certain date. I need to do the following:

    1. When I load the initial list of hotels, I must be able to say that from date X, this hotel has x rooms.

    2. If I know that the capacity will change in the future (e.g., I know that the hotel will construct a new wing next year), I must be able to register that new capacity from that date, without affecting the original entry.

    3. I must be able to pull a report by month that lists each hotel with capacity.


    A sample report would look something like:

    __________Jan 2011 ___Feb 2011 ____ Mar 2011
    Hotel A________200 ________200 _________400
    Hotel B _______ 200 ________200 _________200


    Would I have to create one record per month for each hotel to get the capacity for each month?

    Or is there a way to create one initial record with a start capacity, a second record with the new capacity on a future date, and then have the report know that the months in between the start date and change date should all have the initial capacity?


    Any hints you can offer are greatly appreciated!

  2. #2
    jzwp11 is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    Welcome to the forum!

    As to your table structure, I would have a table to hold the basic information about the hotel. To track changes in capacity, you would just track the change (i.e. enter a record only when there is a change). Since there can be many changes to the capacity over time, that describes a one-to-many relationship which requires a second table.

    So you table to hold the basic info about each hotel

    tblHotel
    -pkHotelID primary key, autonumber
    -txtHotelName
    -Location
    etc.


    tblHotelCapacityTracking
    -pkHotelCapTrackID primary key, autonumber
    -fkHotelID foreign key to tblHotel
    -capacity
    -dteEffective (the effective date of the change in capacity)

    You would add a new record in tblHotelCapacityTracking whenever there is a change to the capacity.

    As to your report, there are a couple ways to do it. One way would be to have a table that just holds the periods of interest and then use a query that joins the tables to generate the report. However, I think that is not the best approach since you would have to add every possible period. I think a Visual Basic for Application (VBA) code solution would probably be better approach, but it would be a custom solution.

    What else are you planning on doing with this database?

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

Similar Threads

  1. How to group by month
    By okrobie in forum Queries
    Replies: 4
    Last Post: 06-09-2011, 04:41 AM
  2. First Day of Next Month
    By swalsh84 in forum Programming
    Replies: 6
    Last Post: 01-14-2011, 12:29 PM
  3. Replies: 5
    Last Post: 11-15-2010, 06:12 PM
  4. First Weds of Month...
    By dweekley in forum Queries
    Replies: 5
    Last Post: 05-17-2010, 12:04 AM
  5. SQL Query by day to end of month
    By tcasey in forum Queries
    Replies: 0
    Last Post: 10-07-2008, 09:55 PM

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