1

I am using Expression Builder to set the value for a calculated field which is supposed to be a percentage. In Expression Builder, this is my statement be executed

Usage: ((([UsedHeight]*[UsedWidth])/([Length]*[Width]))*100)

While selecting the field, in Query design View, I go to Property Sheet so as to set the Format of the field as Percent. The problem is once I change the format to Percent I get value of the field as 4444.44%. If I set the Format of the field to General Number and run the query, I get 44.44444444 which is the exact value. If I change to Fixed Format then I get 44.44 which is the correct value. I have also tried using

 Usage: ([UsedHeight]*[UsedWidth])/([Length]*[Width])*100

but I face the same issue. The values I use for the respective fields are like so

   (50*50)/(75*75)*100

which should return 44.444444.

Why is Ms Access 2007 wrongly computing the value?

Dennis Wanyonyi
  • 368
  • 1
  • 5
  • 18

1 Answers1

1

"Format as percent" takes a decimal value and expresses it as a percent. For example, .5 would display as 50% using that format property.

So, if you want to apply percent format, don't first multiply by 100 ... use this instead:

Usage: ([UsedHeight]*[UsedWidth])/([Length]*[Width])

Or if you want to multiply by 100 in the field expression, choose a different format.

HansUp
  • 95,961
  • 11
  • 77
  • 135
  • Thanks, I had no idea that `Percent` property takes the value in the field and multiplies it by 100 before expressing it as a percentage/. – Dennis Wanyonyi Apr 27 '16 at 16:35