A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Trouble entering percentages in my table



 
 
Thread Tools Display Modes
  #1  
Old March 17th, 2010, 05:09 PM posted to microsoft.public.access
Jenn
external usenet poster
 
Posts: 233
Default Trouble entering percentages in my table

I have a field set up with number datatype and percent format. I am trying
to enter 30% and it comes up 0%. When I put in .30 I get 0% when I put in
300 I get 300%. I can't get this field to show 30%. I need it to be a
number because I want to multiply it by another number in a query. Please
help.
  #2  
Old March 17th, 2010, 06:07 PM posted to microsoft.public.access
KenSheridan via AccessMonster.com
external usenet poster
 
Posts: 1,610
Default Trouble entering percentages in my table

You are apparently using an integer number data type (a long integer is the
default data type for a number when you create a table). If you want to
enter the value as a decimal fraction such 0.3 change the ‘Field Size’
property to Single in the table design and format it as a percentage.

The reason that 30% shows As 0% that entering a percentage sign divides the
value by 100, so it becomes 0.3. As\the field is an integer data type this
is rounded down to zero.

If you want to enter the number as an integer, e.g. 30 then use an integer
data type, but don’t format it. Instead, in a form or report add a label
with the % sign immediately to the right of the control. In a report you can
display it as a percentage in the same way or by setting the ControlSource of
a text box control to =[PercentField] & “%”, or =Format([PercentField]/100,
”Percent”). Not seeing the percentage sign in the table in raw datasheet
view is immaterial as the data should only be exposed to the user in a form
or report.

If you do use an integer then you’ll need to take account of this in any
expressions, e.g. to compute the percentage of another field’s values:

=[Amount] * ([PercentField]/100)

Ken Sheridan
Stafford, England

Jenn wrote:
I have a field set up with number datatype and percent format. I am trying
to enter 30% and it comes up 0%. When I put in .30 I get 0% when I put in
300 I get 300%. I can't get this field to show 30%. I need it to be a
number because I want to multiply it by another number in a query. Please
help.


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/201003/1

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:17 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright 2004-2024 OfficeFrustration.
The comments are property of their posters.