Hi, Much appreciate suggestions so far.
I have 3 linked tables, because of the need to 'defuzz' (sorry not sure of
the technical term
the varied ingredient names in historical recipes to
indicate the same 'source' ingredient:
RECEIPTS INGREDIENTSinReceipts INGREDIENTSIngredientNametoSourceName
[Receipt title] .. [Receipt ID] ..[Ingredient name]
[Receipt id] .. [Ingredient name] .. [Source species]
My approach to find receipt titles with same 3 specific ingredients has been
to use a select query then a crosstab to display the numbers of one or more
of the selected ingredients. Not ideal as all the recipe titles are listed. I
have tried the suggested SQL route but keep getting syntax errors and think
it might be to do with the linking table. Perhaps I need some pointers to
'Introduction to SQL and queries' to better understand the way it should
work?
These were my original attempts:
Select Query
SELECT INGREDIENTSIngredientNametoSourceName.[Source species],
INGREDIENTSIngredientNametoSourceName.[Source species],
INGREDIENTSIngredientNametoSourceName.[Source species], RECEIPTS.[receipt
title], RECEIPTS.collectiontitle
FROM INGREDIENTSIngredientNametoSourceName INNER JOIN (RECEIPTS INNER JOIN
INGREDIENTSinReceipts ON RECEIPTS.[Receipt id] =
INGREDIENTSinReceipts.[Receipt ID]) ON
INGREDIENTSIngredientNametoSourceName.[Ingredient name] =
INGREDIENTSinReceipts.[Ingredient name]
WHERE (((INGREDIENTSIngredientNametoSourceName.[Source
species])="pennyroyal")) OR (((INGREDIENTSIngredientNametoSourceName.[Source
species])="marjoram")) OR (((INGREDIENTSIngredientNametoSourceName.[Source
species])="betony"));
Cross tab query
TRANSFORM Count([20080505select3ingredientsforRXtitle].[Source species]) AS
[CountOfSource species]
SELECT [20080505select3ingredientsforRXtitle].collectiontitle,
[20080505select3ingredientsforRXtitle].[receipt title],
Count([20080505select3ingredientsforRXtitle].[Source species]) AS [Count of]
FROM 20080505select3ingredientsforRXtitle
GROUP BY [20080505select3ingredientsforRXtitle].collectiontitle,
[20080505select3ingredientsforRXtitle].[receipt title]
PIVOT [20080505select3ingredientsforRXtitle].[Source species];
Any further suggestions most welcome! If I can understand this better then
I can match recipes from different collections that have common ingredients,
very useful in research establishing where the recipes came from.