Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2010
    Posts
    8

    Build a relationship between Queries (Howto)

    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.




  2. #2
    jzwp11 is offline VIP
    Windows 7 Access 2007
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    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

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

Similar Threads

  1. Access Query build
    By zarfx4 in forum Access
    Replies: 3
    Last Post: 04-08-2010, 09:53 AM
  2. Build Query from cmdButton
    By thart21 in forum Forms
    Replies: 1
    Last Post: 03-12-2010, 09:43 AM
  3. Hellp with Query Build
    By zarfx4 in forum Queries
    Replies: 0
    Last Post: 05-28-2009, 08:21 AM
  4. Build a book with records
    By phoobie in forum Reports
    Replies: 0
    Last Post: 09-06-2008, 10:56 AM
  5. Can access build a exe file?
    By jianwei87 in forum Programming
    Replies: 1
    Last Post: 08-04-2008, 06:48 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