Percentages

E

Es

I have a table that contains a column with percentages.
When I setup the table, in Design View, I choose for the
percent column the following properties:

Data Type = Number
Field Size = Double
Format = Percent
Decimal Places = Auto

When I enter a number (ex. 30) I get 3000.00%. All I
need is 30%. How can I fix this.

Thanks for any help,
 
L

Lynn Trapp

In order to format a value as percent, Access first multiplies it by 100.
So, if you need 30% to be displayed then you need to enter .3
 
T

Tim Ferguson

When I enter a number (ex. 30) I get 3000.00%. All I
need is 30%. How can I fix this.

Thirty per cent is another way of writing three-tenths or 0.3. If you
want that value in a database field, then you have to enter something
that equates to that value. You could use "0.3" or "30%" or 3E-1 or (in
Excel, for example) "=3/10" and so on.

Thirty is a completely different amount, which can be written as three-
zero or 30.00 or 0.3 * 10^2 or 3E1 or even 3000%.

Sorry for the simple lesson, but I guess that you are hinting at another
problem, being the user interface. It is a pain having to put in all the
percent signs and decimal points and so on and you rightly feel that they
should not have to. The answer is to think about what you are storing and
why. The commonest reason to store a percentage is to multiply something
by it later on:

SELECT FinalCost * VatRate AS TaxApplied, etc...

In this situation, it is just as easy to dump all the percent stuff, and
just put in the 100 factor yourself

SELECT FinalCose * VatRate * 100 As TaxApplied, ...

and then the users just have to enter 17.5 rather than 0.175. If you
want, just to make things clear, you can put a label just to the right of
the textbox on the form with a single "%" character in it.

Hope that helps


Tim F
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top