Results 1 to 9 of 9
  1. #1
    5 Star Lounger
    Join Date
    May 2003
    Location
    Sheffield, Yorkshire
    Posts
    951
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Percentages (2003)

    I have two fields on a query which are causing problems when rounded up. The figures are in two seperate queries, to give me a percentage. One is 83.06 and the 0ther is 82.63. When rounded up, they both are 83, which is right. I have set these as percentages on a report which compares the two, and states whether the result has gone up or down or no change. The result in this case should be no change, but I'm getting down.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Percentages (2003)

    Keep in mind that the display format does not affect the underlying data. If you display 83 on your report, the actual value is still 82.63 (or 83.06). How are you comparing the values?

  3. #3
    5 Star Lounger
    Join Date
    May 2003
    Location
    Sheffield, Yorkshire
    Posts
    951
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Percentages (2003)

    I'm comparing on the report using a control with =IIf([PercentageLast]>[PercentageThis],"Down",IIf([PercentageLast]<[PercentageThis],"Up","No Change")) as the formula.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Percentages (2003)

    Try

    =IIf(Round([PercentageLast],0)>Round([PercentageThis],0),"Down",IIf(Round([PercentageLast],0)<Round([PercentageThis],0),"Up","No Change"))

    This assumes that the PercentageLast and PercentageThis columns return values between 0 and 100. If they are real percentages, i.e. values between 0 and 1 (=100%), use Round(...,2) instead.

  5. #5
    5 Star Lounger
    Join Date
    May 2003
    Location
    Sheffield, Yorkshire
    Posts
    951
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Percentages (2003)

    Getting 'Invalid syntax'

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Percentages (2003)

    You probably introduced a typo somewhere. Check carefully, the expression as posted should work.

  7. #7
    5 Star Lounger
    Join Date
    May 2003
    Location
    Sheffield, Yorkshire
    Posts
    951
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Percentages (2003)

    There must be an error elswhere then. I've typed it in twice, and even cut and pasted from the email into the report, and still get the error message.

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Percentages (2003)

    Without seeing the database, it's impossible to say what causes it.

  9. #9
    Star Lounger
    Join Date
    Nov 2005
    Location
    Edmonton, Alberta, Canada
    Posts
    66
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Percentages (2003)

    The syntax is correct (I tried pasting it into a query). Be careful that you are pasting all and only that into the control source of the control in your report.

Posting Permissions

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