Results 1 to 4 of 4
  1. #1
    Troop is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    15

    Need help with making a Query


    I want to make a query which figures out profit made from a certain type of room according to the month and year. How do I do this? Here is my database. https://www.dropbox.com/s/vxz0xqezti...%20Hotel.accdb

  2. #2
    Estuardo's Avatar
    Estuardo is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2012
    Location
    Portugal
    Posts
    22

    rebuild your db

    G'd morning Troop,
    First you should choose a naming convention for your objects and follow the good practices, such as: no spaces for field names, no special characters (except underscore) do not use the same name for the field for the text box, give meaningful names to your buttons etc. and finally at least build your tables with the 3rd normal form. Rebuild your db now that is in the planning stage.
    Being said that, unless you want to build a messy query you should remove the prices from the room table, create another table for prices and months, then you will easily build any query.
    Question: How do you manually calculate the profit?

  3. #3
    Troop is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    15
    Quote Originally Posted by Estuardo View Post
    G'd morning Troop,
    First you should choose a naming convention for your objects and follow the good practices, such as: no spaces for field names, no special characters (except underscore) do not use the same name for the field for the text box, give meaningful names to your buttons etc. and finally at least build your tables with the 3rd normal form. Rebuild your db now that is in the planning stage.
    Being said that, unless you want to build a messy query you should remove the prices from the room table, create another table for prices and months, then you will easily build any query.
    Question: How do you manually calculate the profit?
    OK, thanks for that. I want to figure out the profit without having to make a table for months and years. How would I go about making the query now?

  4. #4
    Estuardo's Avatar
    Estuardo is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2012
    Location
    Portugal
    Posts
    22
    G'd Afternoon Troop,
    Please don't get me wrong, your design won't let you do that in a "proper" way. I can't tell you with that design what to do because it's just not right.
    Like you have your design, you're not considering anything. If this is a real application you just can't charge me for any service selectively.
    If i stay 5 days and i want the service laundry just 2 of them how are you going to handle? there is no rule to avoid over booking or booking the same room twice. Why do you need a years table? why the 12 months if you can do it by seasons?
    Take a look at this model, try to understand and let me know.
    Attached Files Attached Files
    Last edited by Estuardo; 04-22-2013 at 08:56 AM. Reason: spelling... again...

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

Similar Threads

  1. Need Help/Idea with making query work
    By SilentReyn in forum Queries
    Replies: 9
    Last Post: 03-06-2013, 02:49 PM
  2. Making groups within a query
    By louielol in forum Queries
    Replies: 5
    Last Post: 02-06-2012, 05:33 PM
  3. making a query
    By macattack03 in forum Access
    Replies: 2
    Last Post: 04-23-2011, 12:00 PM
  4. making into update query
    By tom4038 in forum Queries
    Replies: 1
    Last Post: 09-23-2009, 11:19 AM
  5. Making a new field in a query
    By mslieder in forum Queries
    Replies: 3
    Last Post: 05-14-2008, 11:44 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