I'm trying to build a relationship between these two queries. I beleive i'm having a problem because one is an "average of". I just cant get the "average of" field to work on a the form.
I'm trying to build a relationship between these two queries. I beleive i'm having a problem because one is an "average of". I just cant get the "average of" field to work on a the form.
Your table provides the detail while your query provides an average, but how are the two related? Is it an average for a time period? You will need another field in the query that you can use to link to your main table.
Outside of that, your main table is not normalized. If you are tracking meals in a day, in a one day you have many meals/calories which is a one-to-many relationship which should be handled with a separate but related table. Likewise for the workouts since there appears to be more than one workout per day.
tblActivity
-pkActivityID primary key, autonumber
-dteActivity (date of activity)
-weight
tblMealCalories
-pkMealCalsID primary key, autonumber
-fkActivityID foreign key to tblActivity
-fkMealTypesID foreign key to tblMealTypes
-MealCalories
tblMealTypes (breakfast, snack, lunch etc. as records)
-pkMealTypeID primary key, autonumber
-txtMealType
tblWorkouts
-pkWorkoutID primary key, autonumber
-fkActivityID foreign key to tblActivity
-fkWorkoutTypeID foreign key to tblWorkoutTypes
-dtmWorkout (workout time)
-WorkoutCalories
tblWorkOutTypes
-pkWorkOutTypesID primary key, autonumber
-txtWorkOutType