Results 1 to 14 of 14
  1. #1
    starhannes is offline Novice
    Windows 7 Access 2007
    Join Date
    Apr 2010
    Posts
    15

    Query Question

    Hey again

    Ok this is quite complicated to explain.. hope i get my question accross!

    i have 3 tables.


    1) Recipe
    Code:
    Name      ID
    Pizza     1
    Pasta      2
    2) Ingredients


    Code:
    RecipeID(linked to 1) Ingredients    Amounts
    1                        Pizza             1
    2                        Pasta-grams    500
    2                        Sauce-grams    400
    3) Fridge
    Code:
    Ingredients        Amount
    Pizza                 2
    Pasta-grams        600
    Sauce-grams         100
    Now i want to make a query: What recipe can i make with the food that i have in my fridge.
    -> The Pasta recipe should not be shown at all!

    How do i do this? i cannot use Fridge.Amount > Ingredients.Amount because then i will still see

    Recipe Pasta -> because i have sufficient Pasta (600g when 500g required).

    Thanks
    Last edited by starhannes; 04-22-2010 at 03:41 AM. Reason: format

  2. #2
    maximus's Avatar
    maximus is offline Expert
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2009
    Location
    India
    Posts
    931
    How is the table Fridge linked to the other two. Not showing an item is simple. Suppose if I prepare a query combining Recipie and ingredients and in the criteria of ID put this criteria <>2 then pasta is not shown at all. But I want to understand the logic of the whole operation. At what condition will an item be not shown.

    This is what i assume you want to do.
    1) Have a table to record food Item Primary Key ID
    2) Have another Table Receipe which stores the ingredients.
    3) Now at any point the user will give some quantities of various ingredients in his fridge and the query will display all possible reciepes that the user can make with it.


    If I am right let me know .

  3. #3
    starhannes is offline Novice
    Windows 7 Access 2007
    Join Date
    Apr 2010
    Posts
    15
    Yes Maximus more or less if i understand you correctly, thats what i wanna do.

    please see file http://www.2shared.com/file/12739134.../database.html

    i hope you understand how they are linked etc

  4. #4
    maximus's Avatar
    maximus is offline Expert
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2009
    Location
    India
    Posts
    931
    sorry I have ms office 2000 here in the office can you upload a copy of the db in ms access 2000 format.

  5. #5
    starhannes is offline Novice
    Windows 7 Access 2007
    Join Date
    Apr 2010
    Posts
    15

  6. #6
    starhannes is offline Novice
    Windows 7 Access 2007
    Join Date
    Apr 2010
    Posts
    15
    is this so hard to do??

  7. #7
    maximus's Avatar
    maximus is offline Expert
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2009
    Location
    India
    Posts
    931
    No I just seemed to have lost track of you problem will look into it today. Thanks for the reminder.

  8. #8
    starhannes is offline Novice
    Windows 7 Access 2007
    Join Date
    Apr 2010
    Posts
    15
    thanks alot maximus i was afraid i was stuck !! :P

  9. #9
    starhannes is offline Novice
    Windows 7 Access 2007
    Join Date
    Apr 2010
    Posts
    15
    eemmm should i throw out another reminder?? im kinda on a deadline thks alot

  10. #10
    maximus's Avatar
    maximus is offline Expert
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2009
    Location
    India
    Posts
    931
    No need sol will folow in 2 hrs

  11. #11
    maximus's Avatar
    maximus is offline Expert
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2009
    Location
    India
    Posts
    931
    Hi I have done some thing and before I release iti want to know some thing when i see the ID Field of Fridge is Linked to Ingredients of ReceipeIngredients.

    Now my understanding of you database is Simple food intems and its reciepe are stored in tables User supplies the ingredients that are there in his fridge and he is given a selection of the most likely dishes he can make with them. So basically here is what I have to do find out all the reciepies that you can make with the ingredients in the fridge not considering the quntities and after selecting them out rule out the dishes that cannot be prepared due to insufficent ingredients.

  12. #12
    starhannes is offline Novice
    Windows 7 Access 2007
    Join Date
    Apr 2010
    Posts
    15
    Quote Originally Posted by maximus View Post
    Hi I have done some thing and before I release iti want to know some thing when i see the ID Field of Fridge is Linked to Ingredients of ReceipeIngredients.

    Now my understanding of you database is Simple food intems and its reciepe are stored in tables User supplies the ingredients that are there in his fridge and he is given a selection of the most likely dishes he can make with them. So basically here is what I have to do:
    1. find out all the recipes that you can make with the ingredients in the fridge not considering the quantities and
    2. after selecting them out rule out the dishes that cannot be prepared due to insufficient ingredients.
    Yes exactly thats what i want to !

    You want to know why the ID field of fridge is linked to Ingredients of RecipeIngredients??

    To be honest, i needed to link the Fridge to something and i didnt know what... So i made the Fridge also a "list of all ingredients", where recipeIngredients uses the "lists of all ingredients" to make recipes.
    Now, of course there will be many ingredients in the Fridge table that are quantity 0 (when they are not in the fridge), but that doesnt affect the link with RecipeIngredients table...


    Hope that is clear?

    thanks alot by the way!

  13. #13
    starhannes is offline Novice
    Windows 7 Access 2007
    Join Date
    Apr 2010
    Posts
    15
    would you be able to send me what you have done so far please?

  14. #14
    starhannes is offline Novice
    Windows 7 Access 2007
    Join Date
    Apr 2010
    Posts
    15
    could i bump this please?

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

Similar Threads

  1. Query Question
    By Guiseppe in forum Queries
    Replies: 5
    Last Post: 03-23-2010, 04:32 PM
  2. Query Criteria Question
    By jrockusa in forum Queries
    Replies: 0
    Last Post: 11-13-2009, 09:16 AM
  3. Query with a question
    By sagit3 in forum Queries
    Replies: 0
    Last Post: 06-11-2009, 07:10 AM
  4. Query Question
    By blewis in forum Queries
    Replies: 0
    Last Post: 04-16-2009, 01:37 PM
  5. Should be simple Query Question
    By brj1 in forum Queries
    Replies: 2
    Last Post: 03-04-2006, 01:11 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