Results 1 to 7 of 7
  1. #1
    Star Lounger
    Join Date
    Jan 2001
    Posts
    71
    Thanks
    0
    Thanked 0 Times in 0 Posts

    rounding in a report (access 97)

    I have a text box in a report which averages numbers. If there is any remainder I need to round up to the next whole number. The avg function does not do it or I am doing something wrong. Thanks for your assistance.
    Mike

  2. #2
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    USA
    Posts
    379
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: rounding in a report (access 97)

    The average function does not round the number, but if you set the Format property for the text box on the report to Integer it will round to the integer value.

  3. #3
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: rounding in a report (access 97)

    You can also wrap your Avg expression in a Round() function, which allows you to specify the number of decimal places to use. If you do so, though, you need to be aware of how Round handles determinant values, i.e., what it does with .5, for example).
    Charlotte

  4. #4
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    USA
    Posts
    379
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: rounding in a report (access 97)

    I honestly did not think that Access 97 had a built-in Round function. I wrote one myself when I needed to round and a format property wasn't a good alternative.Could you tell me where it is?

  5. #5
    Star Lounger
    Join Date
    Jan 2001
    Posts
    71
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: rounding in a report (access 97)

    I looked at the properties for the text box and integer is not one of the choices. I have been using "fixed". Am I looking in the wrong place?
    Mike

  6. #6
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: rounding in a report (access 97)

    Ack! You're right, I always forget to scroll down far enough to see which version of Access was specified, and I was thinking of the Access 2000/VBA 6 Round function. <img src=/S/blush.gif border=0 alt=blush width=15 height=15>
    Charlotte

  7. #7
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: rounding in a report (access 97)

    Fixed is a format while Integer is a datatype. Fixed returns the integer portion of a number. You probably want Fixed unless the number is very large. In that case, you may want to use Standard and set the number of decimal places to zero. That will give you commas between the thousands, which Fixed doesn't do.
    Charlotte

Posting Permissions

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