Results 1 to 5 of 5
  1. #1
    jvrsoto is offline Novice
    Windows XP Access 2007
    Join Date
    Oct 2011
    Posts
    2

    Unhappy Recursive data

    I am building a database that will include ingredients and subingredients (subingredients can have more subingredients).

    Ex.
    ID Ingredient / SubIngredients
    1 Butter Finger / Peanut Butter
    2 Peanuts
    3 Salt
    4 Peanut Oil
    5 Peanut Butter / Peanuts
    5 Peanut Butter / Salt
    5 Peanut Butter / Peanut Oil

    How can I make a query, or function where I can just select Butter Finger as my Ingredient but it knows that it includes Peanut Butter, and Peanut Butter includes Peanuts, Salt, and Peanut Oil?

    Of course Salt and Peanuts might be subingredients or main ingredients in another formula (so a parent Id will not work).



    Thanks

  2. #2
    hertfordkc is offline 18 year novice
    Windows XP Access 2007
    Join Date
    Mar 2011
    Posts
    481
    intuition here: you need to have a table of intermediate ingredients and another table of basic ingredients, e.g salt, flour....
    I'll think about it some more.

  3. #3
    jvrsoto is offline Novice
    Windows XP Access 2007
    Join Date
    Oct 2011
    Posts
    2
    Thanks for the response. But here is my thing, Peanuts could be a main ingredient, or a subingredient at second or third level, etc.

  4. #4
    RayMilhon is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Aug 2011
    Location
    Southern California
    Posts
    1,071
    What it sounds like your looking for is an object oriented Data Structure not relational. Don't think this is possible with Access. SQL Server 2008 includes the Hierarchical data structure which may work but I have 0 experience with this structure. You could also look at Cache' which is an object oriented Database at least it used to be haven't used or seen it in over 3 years.

  5. #5
    RayMilhon is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Aug 2011
    Location
    Southern California
    Posts
    1,071
    By the way You can check out Cache' @ www.intersystems.com

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

Similar Threads

  1. Replies: 13
    Last Post: 10-26-2011, 03:49 AM
  2. Recursive Report!
    By Rawb in forum Reports
    Replies: 7
    Last Post: 01-26-2011, 04:00 PM
  3. Recursive Tables!
    By Rawb in forum Database Design
    Replies: 1
    Last Post: 01-26-2011, 02:46 PM
  4. Replies: 4
    Last Post: 01-05-2011, 07:56 AM
  5. Recursive Lookup and display?
    By madyson in forum Access
    Replies: 3
    Last Post: 12-15-2009, 09:01 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