Results 1 to 4 of 4
  1. #1
    libraccess's Avatar
    libraccess is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2012
    Location
    Napier New Zealand
    Posts
    129

    Rounding a number in a query

    I have this query which is for a chart where the number is displayed. I have tried to eliminate the decimal points for an average but no joy. Apart from that the charts work OK Where am I going wrong please?



    SELECT (Format([DateMain],"mmm"" '""yy")) AS Expr1, Avg(Round([DelVol],1)) AS Expr2, Sum(qryChartDelivCount.CountOfDelVol) AS SumOfCountOfDelVol, qryChartDelivCount.DestinationFROM qryChartDelivCount
    GROUP BY (Format([DateMain],"mmm"" '""yy")), qryChartDelivCount.Destination, (Year([DateMain])*12+Month([DateMain])-1)
    HAVING (((qryChartDelivCount.Destination)="Springfield"))
    ORDER BY (Year([DateMain])*12+Month([DateMain])-1);

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Try reversing the functions. You're averaging the rounded number, you want to round the average.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    libraccess's Avatar
    libraccess is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2012
    Location
    Napier New Zealand
    Posts
    129

    Smile It sort of seems obvious now

    ----------, Round(Avg([DelVol]),0) AS Expr2, ---------

    thanks very much

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Happy to help.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. percent query rounding less than .5 up
    By jtmo3 in forum Queries
    Replies: 3
    Last Post: 05-04-2012, 02:52 PM
  2. rounding down
    By markcranmer in forum Queries
    Replies: 1
    Last Post: 10-11-2011, 09:43 AM
  3. Rounding number up to half hour
    By crxftw in forum Forms
    Replies: 2
    Last Post: 08-23-2011, 07:29 AM
  4. Replies: 6
    Last Post: 07-25-2011, 01:54 PM
  5. Rounding the Average in a Query
    By jakelufkin in forum Access
    Replies: 3
    Last Post: 06-19-2009, 08:31 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