• Percentages (2003)

    Author
    Topic
    #433825

    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.

    Viewing 0 reply threads
    Author
    Replies
    • #1021366

      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?

      • #1021376

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

        • #1021382

          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.

          • #1021406

            Getting ‘Invalid syntax’

            • #1021409

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

            • #1021421

              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.

            • #1021422

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

            • #1021435

              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.

    Viewing 0 reply threads
    Reply To: Percentages (2003)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: