sabrina_spillane
asked on
Access 2003 - Format Decimal Numbers into a whole number in a report.
Hi All,
I have a query where one of it's fields is a percentage in decimal numbers and I want to make this decimal number when it appears in the report a whole number with no decimal places.
I tried formating it in the property section of the report and I set the property called "Format" to "Percent" and set the "Decimal Places" property to "0" so that it wouldn't show any decimal places but this is not what happened. Then I changed in to "General Number" and "Auto" and that gave me two decimal places or something like that.
Can anyone tell me the correct way to set these properties so that I will get a whole number for the percent value and no decimal places.
Thanks again in advance for everything.
I have a query where one of it's fields is a percentage in decimal numbers and I want to make this decimal number when it appears in the report a whole number with no decimal places.
I tried formating it in the property section of the report and I set the property called "Format" to "Percent" and set the "Decimal Places" property to "0" so that it wouldn't show any decimal places but this is not what happened. Then I changed in to "General Number" and "Auto" and that gave me two decimal places or something like that.
Can anyone tell me the correct way to set these properties so that I will get a whole number for the percent value and no decimal places.
Thanks again in advance for everything.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You can use this function: http://www.mvps.org/access/modules/mdl0054.htm
CStr(Cint(MyField * 100)) & "%"
<Format" to "Percent" and set the "Decimal Places" property to "0" so that it wouldn't show any decimal places but this is not what happened.>
what did happen when you set the properties this way?
I just tested those settings on a decimal field (some have 3-4 decimal places) and did get whole numbers with no extra decimals
Steve
what did happen when you set the properties this way?
I just tested those settings on a decimal field (some have 3-4 decimal places) and did get whole numbers with no extra decimals
Steve
ASKER
When i set the format up as follows "Percent" and "Decimal Place = 0" then I get a whole number alright but it is a whole number including some of the decimals.
What I mean is this here is an example:
So I have a
Result Percent in Report How I want it to show up in report
16.67654 1667% 16% (the % sign doesn't have to be there if it can't be it doesn't matter)
So it is like it is takeing the whole number 16 and adding the first two decimal places into the whole number as well. From the result i just want to see the whole number (16) with or with out the % that doesn't matter.
Thanks.
What I mean is this here is an example:
So I have a
Result Percent in Report How I want it to show up in report
16.67654 1667% 16% (the % sign doesn't have to be there if it can't be it doesn't matter)
So it is like it is takeing the whole number 16 and adding the first two decimal places into the whole number as well. From the result i just want to see the whole number (16) with or with out the % that doesn't matter.
Thanks.
Try Format(MyField,"#0") & "%"