Sashaski
asked on
Rounding A Calculated Field in an Access Query
Hi experts!
Here is the code I'm using for my calculated field:
Percentage: ([quantity]*[makeup])/100
The result currently shows two decimal points. I would like this field to round to the nearest whole number, no decimals. Please help!
Thank you.
Here is the code I'm using for my calculated field:
Percentage: ([quantity]*[makeup])/100
The result currently shows two decimal points. I would like this field to round to the nearest whole number, no decimals. Please help!
Thank you.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Well, you could do it in the formatting of the field, just set the # of decimals to 0
Or you could use the Round() function:
Percentage: Round([quantity]*[makeup]/ 100)
Or you could use the Round() function:
Percentage: Round([quantity]*[makeup]/
ASKER
Brilliant! Amazing the time blown on the small things...I appreciate you!
You are welcome.
I actually like FormatNumber() better, because IF ... you need two dec pts, you can't get that with Round() - in some cases:
?Round(55/22,2)
2.5
?FormatNumber(55/22,2)
2.50
mx
I actually like FormatNumber() better, because IF ... you need two dec pts, you can't get that with Round() - in some cases:
?Round(55/22,2)
2.5
?FormatNumber(55/22,2)
2.50
mx
ASKER
Great tip to add to my plethora of tips, in fact I should create a database for database tips!
Percentage: FormatNumber(([quantity]*[
mx