Jump to content

Searching


murra1a

Recommended Posts

Hi,

 

I have 3 tables:

ingredient, recipes, onhand

 

ingredient is 2 fields: key, name

 

recipes is several fields, important one is ingredients which is keys from ingredients table separated by commas eg 2,3,15,99

this essentially connects the list of ingredients in the recipe to ingredient names in the 1st table

 

the third table is a list of ingredients I have on hand and their keys from the ingredient table.

 

 

What I want to do is to search the recipe table for recipes I can make with the ingredients I have on hand

and recipes for which I am missing only a few ingredients

 

I am completely confused about how to do this

Thanks

Ryan

Link to comment
Share on other sites

Here is a sample of the three tables

 

Ingredients:

Key Ingredient

1    Bacon

2    Tomato

3    Lettuce

4    Bread

5    Eggs

 

Recipes:

Recipe                    Ingredients

BLT                        1,2,3,4

Bacon and Eggs      1,5

 

OnHand:

StuffOnHand        IngredientKey

Bacon                  1

Tomato                2

Eggs                    5

 

I want to output:

1. That I can make bacon and eggs

2. That I can make a BLT if I get Lettuce and Bread

 

I hope that is more clear

Thanks

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.