Results 1 to 4 of 4
  1. #1
    mejia.j88 is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Nov 2011
    Location
    california
    Posts
    228

    averages in a report?

    hi guys,

    i have a table which includes part number, and depending on the part, up to three measurements. my table looks something like this:
    Part_Number Measurement1 Measurement2 Measurement3
    ZR50SG 0.0905 0.091 0.095
    .
    .
    .
    1N6500 0.03 0.032

    etc.

    i want to create a report that will show the part number and it's average measurements.



    the problem: i'm not sure how to write a program or SQL or what that will average the measurements for me. some parts will have up to 100 entries, where others only about 20.

    another thing i'd like to do is be able to select a date range and see the averages there.

    any help will be greatly appreciated. thank you.

  2. #2
    hertfordkc is offline 18 year novice
    Windows XP Access 2007
    Join Date
    Mar 2011
    Posts
    481

    You need a table of part numbers and another table

    for readings, where each reading references a part number.
    Once you have that organization, you can easily create a query which calculates averages by part number regardless of the number of readings.

  3. #3
    mejia.j88 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Nov 2011
    Location
    california
    Posts
    228
    hi hertfordkc,

    i have both of those tables set, but how would such a query work?
    do i have to make a relationship between the two with part number as their commonality?

  4. #4
    hertfordkc is offline 18 year novice
    Windows XP Access 2007
    Join Date
    Mar 2011
    Posts
    481

    My earlier reply didn't mention that you should define your parts table

    with a primary key, which would be used in the measurements table to tie back to the part number Then you can define the relationship between the two tables.

    You say that you have the two tables set. If you created a table that has rows with each row containing the part number and a single measurement, then you don't really need the part number in a separate table. Using two tables and a primary key as the link is normally a much better design. However, unless you are working on something that will turn into a really big database (maybe thousands of parts and hundreds of thousands of measurements) it probably isn't worth your time to redo the tables.

    Either way, you can use the query wizard to satisfy your requirements.
    The following links show how to set up the type of query you'll need.
    allenbrowne.com/ser-67.html

    office.microsoft.com/.../access.../make-summary-data-easier-to-read-...

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

Similar Threads

  1. Averages
    By Nixx1401 in forum Queries
    Replies: 1
    Last Post: 05-26-2011, 10:08 AM
  2. Replies: 4
    Last Post: 12-13-2010, 05:33 PM
  3. Replies: 2
    Last Post: 08-25-2010, 01:42 PM
  4. Replies: 23
    Last Post: 06-30-2010, 02:05 PM
  5. Query showing averages for groups
    By AnthonyTesta in forum Queries
    Replies: 1
    Last Post: 02-03-2010, 09:04 PM

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