Percentage

  • Thread starter Thread starter John
  • Start date Start date
J

John

Hi,
My table has a field called "Discount".
The field is set to Number and the format set to Percent.
When I put in the number "1" I get 100% correct!
when I put in the number "0.10" I should get 10% but I get 0%. I need to be
able to achieve 10%.

Any Ideas?

Kind Regards

John
 
Open the table in design view.
Select the Discount field.
Change the Field Size property to:
Double.

The integer types can store whole numbers only. Double works with fractions.

You may also be interested in this article:
Enter a value as a percent
at:
http://allenbrowne.com/casu-16.html
It explains how, in a form, you can type just 10 and have it interpreted as
10%. (Access 2007 will do that for you without the code.)
 
Perfect
Thanks Allen

Kind Regards

John


Allen Browne said:
Open the table in design view.
Select the Discount field.
Change the Field Size property to:
Double.

The integer types can store whole numbers only. Double works with
fractions.

You may also be interested in this article:
Enter a value as a percent
at:
http://allenbrowne.com/casu-16.html
It explains how, in a form, you can type just 10 and have it interpreted
as 10%. (Access 2007 will do that for you without the code.)
 

You originally chose INTEGER. If you want to restrict your values to
two decimal places (0.01, 0.02, 0.03 etc) you may have problems with
the DOUBLE FLOAT type because of its inexact/inaccurate nature. I would
recommend you instead use the DECIMAL type, being a scaled integer type
with guaranteed accuracy. For example DECIMAL(3, 2) i.e. precision=3,
scale=2, with an appropriate validation rule e.g. BETWEEN 0.00 AND
1.00.

Jamie.

--
 
Back
Top