Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2005
    Posts
    31

    Exclamation Unanswered: Too many numbers after the decimal when calculating Average. Can you Help?

    Hello. This is my first poat here, how are you guys?

    My question today is how can I calculate the average of Number Values stored in a field returning only results containing 1 decimal after the number?

    Here's what I got for a query:

    SELECT Avg(Quality.QScore) AS AverageTeamQuality FROM Quality;

    The problem is when I calculate the average of QScore field containing let's say, scores 80, 65, 40 the following displays on the Quality Listbox found in my Form:

    67.6666666666667

    Is there a way to make the Quality Listbox only show something like:

    67.6

    Thanx for all your help in advance!

  2. #2
    Join Date
    Feb 2004
    Location
    Canada
    Posts
    133
    Try:
    SELECT Round(Avg(Quality.QScore),1) AS AverageTeamQuality FROM Quality;

    That should round your example to 67.7

  3. #3
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    Separate the requirements for the data handling and the presentation

    You can use round(<number>,<decimalplaces to control the rounding

    you can control the neimber of decimals in a form by setting the format of the control (by altering the properties) to 'fixed' and the number of decimal as required.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •