Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
SQL Server 2005
»
T-SQL (SS2K5)
»
Round
Round
Rate Topic
Display Mode
Topic Options
Author
Message
tali_benyehuda
tali_benyehuda
Posted Sunday, February 01, 2009 7:01 AM
Grasshopper
Group: General Forum Members
Last Login: Wednesday, March 27, 2013 7:21 AM
Points: 13,
Visits: 129
Hi there,
I would like to round the following number: 12,999 to 13,000 and I cant find a way, all the round options are decimal rounds.
anyone has an idea?
thanks!
Post #647694
John H Marsh
John H Marsh
Posted Sunday, February 01, 2009 7:52 AM
Ten Centuries
Group: General Forum Members
Last Login: Thursday, February 28, 2013 1:54 AM
Points: 1,325,
Visits: 1,376
Hello,
The following script will Round 12999 to 13000:-
Select Round(12999, -1)
This works for the example that you provided, but what is the underlying rounding algorithm that you need?
Regards,
John Marsh
www.sql.lu
SQL Server Luxembourg User Group
Post #647699
Jeff Moden
Jeff Moden
Posted Sunday, February 01, 2009 9:04 AM
SSC-Dedicated
Group: General Forum Members
Last Login: Today @ 12:18 PM
Points: 32,910,
Visits: 26,804
John is correct. To become better familiar with the ROUND function, take a look a Books Online... it has a full description and many examples to help you determine what you actually need.
--Jeff Moden
"
RBAR
is pronounced "ree-bar" and is a "Modenism" for "
R
ow-
B
y-
A
gonizing-
R
ow".
First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
Post #647713
« Prev Topic
|
Next Topic »
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.