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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Rounding Number to nearest half 2

Status
Not open for further replies.

TimTDP

Technical User
Feb 15, 2004
373
ZA
In access 2000 I need to round numbers to the nearest half
ie.
10.30 becomes 10.50
10.20 becomes 10.00
10.65 becomes 10.50
10.85 becomes 11.00

how can I do this?
 
How about:

[tt]Y = IIf(X - Int(X) < 0.26, Int(X), IIf(X - Int(X) < 0.76, Int(X) + 0.5, Int(X) + 1))[/tt]
 
Thanks
I was hoping for an inbuilt function!
 
How about
Code:
Select Round(Num * 2, 0) / 2


Note: GMastros gave me this for SQL server, not sure if it works with Access.

 
Thanks for that, CaptainD, it works for me.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top