I have tblDiet which contains information about food people eat during each "MealID" and I want to analyze the foods in the context of the MealID. In other words, let's say I want:
1. Every MealID where only pears were eaten
2. Every MealID where only pears and oranges were eaten
3. And the cherry on top: Every MealID where apples were not eaten
Right now I am figuring this stuff out by concatenating the food per MealID into one field and running queries against those records. I think you all probably know a better way.
name,MealID,qty,food,Date and Time
abe,A001,1,orange,1/2/2013 5:51
abe,A001,3,pear,1/2/2013 5:52
abe,A001,3,orange,1/2/2013 5:53
abe,A001,2,orange,1/2/2013 5:54
abe,A002,2,plum,1/2/2013 5:45
abe,A002,1,orange,1/2/2013 5:46
abe,A002,7,onion,1/2/2013 5:49
abe,A003,2,orange,1/2/2013 6:00
abe,A003,3,orange,1/2/2013 6:04
abe,A003,2,pear,1/2/2013 6:12
abe,A003,1,orange,1/2/2013 6:13
jen,A004,2,orange,1/3/2013 7:15
jen,A004,3,orange,1/3/2013 7:16
jen,A004,2,orange,1/3/2013 7:22
jen,A004,1,orange,1/3/2013 7:24
jen,A005,2,orange,1/3/2013 7:22
jen,A005,1,orange,1/3/2013 7:24
jen,A005,3,pear,1/3/2013 7:27
jen,A006,3,apple,1/3/2013 8:31
jen,A006,3,pear,1/3/2013 8:37
jen,A006,1,orange,1/3/2013 8:50
jen,A006,2,orange,1/3/2013 8:53
lisa,A007,2,orange,1/3/2013 7:18
lisa,A007,1,onion,1/3/2013 7:21
lisa,A007,3,orange,1/3/2013 7:27
lisa,A007,1,apple,1/3/2013 7:41
lisa,A008,2,orange,1/2/2013 5:43
lisa,A008,1,orange,1/2/2013 5:45
lisa,A008,2,orange,1/2/2013 5:50
lisa,A008,2,banana,1/2/2013 5:58
lisa,A009,2,banana,1/2/2013 7:15
lisa,A009,2,orange,1/2/2013 7:15
lisa,A009,1,orange,1/2/2013 7:17
lisa,A009,2,orange,1/2/2013 7:19
mike,A010,1,orange,1/2/2013 7:25
mike,A010,3,orange,1/2/2013 7:27
mike,A010,2,orange,1/2/2013 7:28
mike,A011,2,pear,1/2/2013 8:22
mike,A011,3,pear,1/2/2013 8:24
mike,A011,3,pear,1/2/2013 8:27
I joined this forum in 2005. I am still a hack.
1. Every MealID where only pears were eaten
2. Every MealID where only pears and oranges were eaten
3. And the cherry on top: Every MealID where apples were not eaten
Right now I am figuring this stuff out by concatenating the food per MealID into one field and running queries against those records. I think you all probably know a better way.
name,MealID,qty,food,Date and Time
abe,A001,1,orange,1/2/2013 5:51
abe,A001,3,pear,1/2/2013 5:52
abe,A001,3,orange,1/2/2013 5:53
abe,A001,2,orange,1/2/2013 5:54
abe,A002,2,plum,1/2/2013 5:45
abe,A002,1,orange,1/2/2013 5:46
abe,A002,7,onion,1/2/2013 5:49
abe,A003,2,orange,1/2/2013 6:00
abe,A003,3,orange,1/2/2013 6:04
abe,A003,2,pear,1/2/2013 6:12
abe,A003,1,orange,1/2/2013 6:13
jen,A004,2,orange,1/3/2013 7:15
jen,A004,3,orange,1/3/2013 7:16
jen,A004,2,orange,1/3/2013 7:22
jen,A004,1,orange,1/3/2013 7:24
jen,A005,2,orange,1/3/2013 7:22
jen,A005,1,orange,1/3/2013 7:24
jen,A005,3,pear,1/3/2013 7:27
jen,A006,3,apple,1/3/2013 8:31
jen,A006,3,pear,1/3/2013 8:37
jen,A006,1,orange,1/3/2013 8:50
jen,A006,2,orange,1/3/2013 8:53
lisa,A007,2,orange,1/3/2013 7:18
lisa,A007,1,onion,1/3/2013 7:21
lisa,A007,3,orange,1/3/2013 7:27
lisa,A007,1,apple,1/3/2013 7:41
lisa,A008,2,orange,1/2/2013 5:43
lisa,A008,1,orange,1/2/2013 5:45
lisa,A008,2,orange,1/2/2013 5:50
lisa,A008,2,banana,1/2/2013 5:58
lisa,A009,2,banana,1/2/2013 7:15
lisa,A009,2,orange,1/2/2013 7:15
lisa,A009,1,orange,1/2/2013 7:17
lisa,A009,2,orange,1/2/2013 7:19
mike,A010,1,orange,1/2/2013 7:25
mike,A010,3,orange,1/2/2013 7:27
mike,A010,2,orange,1/2/2013 7:28
mike,A011,2,pear,1/2/2013 8:22
mike,A011,3,pear,1/2/2013 8:24
mike,A011,3,pear,1/2/2013 8:27
I joined this forum in 2005. I am still a hack.