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

How to round numbers to the nearest integer?

Status
Not open for further replies.

Andel

Programmer
Joined
Feb 15, 2001
Messages
366
Location
US
For example,

956 should round to 950
985.5 should round to 1000
145 should round to 150
and so on...

How to script this in sql?

I'm trying to use the ROUND function in sql but it doesn't work.

Thanks for your help.

Andel
 
Devide by 10 use the round function, then multiply by 10.

Denny
MCSA (2003) / MCDBA (SQL 2000)

--Anything is possible. All it takes is a little research. (Me)

[noevil]
(My very old site)
 
985.5 should round to 1000" doesn't fit... maybe the base for rounding is 50?

------
heisenbug: A bug that disappears or alters its behavior when one attempts to probe or isolate it
schroedinbug: A bug that doesn't appear until someone reads source code and realizes it never should have worked, at which point the program promptly stops working for everybody until fixed.

[ba
 
thanks for your responses.

yes, round to the nearest 50.

i'll try mrdenny's recommendation.

thanks

Andel
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top