Hi All
I want to round a decimal figure UP but only to the nearest .5 ( ie 1.27 would round to 1.5 or 1.75 would round to 2.0)
Any thoughts please
Toncc
Hi All
I want to round a decimal figure UP but only to the nearest .5 ( ie 1.27 would round to 1.5 or 1.75 would round to 2.0)
Any thoughts please
Toncc

This month, every Windows Secrets subscriber can download a one-chapter excerpt of Windows 7: The Missing Manual.Windows 7: The Missing Manual provides valuable information to help you overcome these difficulties in learning a new operating system. Subscribe today to download your free excerpt.
Assuming I can trust my notes, the heart of the following code came from the Utter Access website:
<pre>Function RoundHalf(sngTarget As Single) As Single
RoundHalf = RoundToTheNearest(sngTarget, 0.5)
End Function
Function RoundToTheNearest(sngTarget As Single, sngDividend As Single) As Single
Dim dblTarget As Double
Dim dblDividend As Double
Dim dblRTN As Double
dblTarget = CDbl(sngTarget)
dblDividend = CDbl(sngDividend)
dblRTN = Int((dblTarget / dblDividend) + 0.5) * dblDividend
RoundToTheNearest = CSng(dblRTN)
End Function</pre>
If you want to avoid VBA code, you can use the following expression in a query to round a field Amount up to the nearest 0.5:
Int(([Amount]+0.499999999999999999999)/0.5)*0.5
As control source of a text box on a form or report, just prefix the expression with =
=Int(([Amount]+0.499999999999999999999)/0.5)*0.5
The use of 0.499999999999999999999 instead of 0.5 prevents multiples of 0.5 from being rounded up to the next higher multiple.