Solved

Access 2003 - Format Decimal Numbers into a whole number in a report.

Posted on 2006-07-20
6
749 Views
Last Modified: 2008-01-16
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.
0
Comment
Question by:sabrina_spillane
6 Comments
 
LVL 26

Accepted Solution

by:
dannywareham earned 125 total points
ID: 17146461
When you say "make whole" do you mean round up, or just lose the decimals?

You can format to lose:

Format([youfield],"0")

Round will require a function
0
 
LVL 26

Expert Comment

by:dannywareham
ID: 17146466
0
 
LVL 38

Expert Comment

by:Jim P.
ID: 17146557
CStr(Cint(MyField * 100)) & "%"
0
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 
LVL 39

Expert Comment

by:stevbe
ID: 17146714
<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
0
 

Author Comment

by:sabrina_spillane
ID: 17147139
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.
0
 
LVL 38

Expert Comment

by:Jim P.
ID: 17147179
Try Format(MyField,"#0") & "%"
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Sending email from List Data 2 51
DSum for Access 6 47
combine ShipTo and BillTo Address 3 23
Access 2010 db.Execute using dbFailOnError and dbSeeChanges 10 49
This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now