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

Rounding values to 1/4

Status
Not open for further replies.

emikoo

Technical User
Jul 12, 2002
37
0
0
NL
Hi,

Is there an easy way to round the values in a MS2000 Access query to quarters (x.25, x.50, x.75 or x.00). Example:

3.17 = 3.00
3.18 = 3.25
3.37 = 3.25
3.38 = 3.50
3.62 = 3.50
3.63 = 3.75
3.87 = 3.75
3.88 = 4.00

Thnxs in advance,

EK


 
it's easy

multiply by 4 and round up to nearest integer, then divide by four point oh oh

select int(val*4+0.5)/4.00
from yourtable

by the way, your first example, 3.17, rounds to 3.25 -- i think you were thinking of 3.12

:)

rudy
 
Rudy,

Thank you. After I posted it, had the same idea:

Round(value*4,0)/4.00

Thank you for your help.

EK


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top