Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ROUNDING IN ACCESS

Status
Not open for further replies.

SILHOUETE2

Programmer
Joined
Jan 2, 2003
Messages
2
Location
US
Hi, I am developing a database in Access 2000 and I am having trouble with rounding certain numbers in a specific way. I know that there is a roundup and rounddown function in Excel...is there one in Access as well? So far I have only been able to find the Round function and all it does is standard rounding. I need certain fields to always round up to the nearest whole number and I have another field that needs to round up to the nearest 1/8th of an inch. Any suggestions on how I might accomplish this?....Any suggestions would be greatly appreciated!!
 
function roundUp(dNum)
if int(dNum) = dNum then
roundUp = dNum ' it's already an integer
else
roundUp = int(dNum + 1) add 1, then trunc the decimals
end if
end function
 
function roundUpEighth(dNum)
roundUpEighth = (8 * roundUp(dNum)) / 8
end function
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top