Results 1 to 12 of 12
  1. #1
    jackyoung2012 is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Mar 2012
    Posts
    14

    Query wont average all required columns

    Hi everyone,



    I have a table which has 8 columns of different score categories (service, speed, etc), which can be scored 0-5 each. I am trying to build a query to show the average score for each category, it will show me the average for 6 of the columns but not for the other two! I don't know why this is doing this, as far as I can see they are all set up the same way, but whenever I try to build a summary query using the wizard it doesnt give me the option to calculate averages for two of the columns, any ideas?

    Many thanks

    Jack

  2. #2
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Try creating it yourself, without using the wizard.

  3. #3
    jackyoung2012 is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Mar 2012
    Posts
    14
    Just tried that, it appears to have worked, but for some erason the averages for some of the boxes exceeds 5! How can this be possible if the maximum value you can pick is 5?!

  4. #4
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Not sure - can you attach your database (or part thereof)?

  5. #5
    jackyoung2012 is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Mar 2012
    Posts
    14
    it wont allow me to post it as the filesize is too large, but you can download it from http://dl.dropbox.com/u/1576328/Test...Database.accdb

    Any help would be greatly appreciated!

  6. #6
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    There are actually some values on the table that are 6. That will put your average > 5.

  7. #7
    jackyoung2012 is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Mar 2012
    Posts
    14
    I haev just checked and that isnt the same as what I have in my sheet, I dont know why that has 6 in it?

  8. #8
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    This is what I am showing:

    Click image for larger version. 

Name:	Untitled.gif 
Views:	5 
Size:	140.8 KB 
ID:	6841

  9. #9
    jackyoung2012 is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Mar 2012
    Posts
    14
    I see that, but what query is that from my sheet? Sorry if I am being a bit dumb here, I am teaching myself as I go along!

  10. #10
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    I am troubleshooting. I took your query and made my own, I used the same table columns that you used except that I removed the averaging, in order to look at the data prior to messing with it. Opening the table would produce the same results. In development, you must always know the answer before you create something - i.e. during the analysis of what you are trying to create include the results that are expected. So I went back to the beginning, the raw data.

  11. #11
    jackyoung2012 is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Mar 2012
    Posts
    14
    Ahh right, it looks like what is happening is the query is pulling the values from the primary key auto number rather than the actual score, any idea how to amend the query to pull back the correct values?

  12. #12
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    I put them side by side. On the left is the raw data from the Candidate table. On the right is the query with the averages. If you manually create the values you will see that the query is correct - 3+4+5+6 - average = 4.5.
    Click image for larger version. 

Name:	Untitled.jpg 
Views:	3 
Size:	177.7 KB 
ID:	6842

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

Similar Threads

  1. Query search wont display null fields
    By Coffee in forum Queries
    Replies: 2
    Last Post: 08-08-2011, 09:00 AM
  2. Moved Database - Now Query wont run
    By elb1999 in forum Queries
    Replies: 3
    Last Post: 07-12-2011, 10:19 AM
  3. Replies: 13
    Last Post: 05-28-2010, 11:57 AM
  4. Query and subquery wont work with combo box
    By jbg8931 in forum Queries
    Replies: 0
    Last Post: 05-09-2010, 10:24 AM
  5. Replies: 0
    Last Post: 02-14-2007, 01:35 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