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
»
SQL Server 2005 General Discussion
»
rounding up to the next whole number
rounding up to the next whole number
Rate Topic
Display Mode
Topic Options
Author
Message
slkorf
slkorf
Posted Monday, April 14, 2008 7:35 PM
Forum Newbie
Group: General Forum Members
Last Login: Tuesday, March 10, 2009 8:47 AM
Points: 2,
Visits: 6
I'm trying to round a number up to the next whole number in sql server 2005 query analyzer.
i.e. 12.2 needs to display as 13
I've tried the round function but the value displayed is 12. I researched online and found the 'int' function but sql server 2005 doesn't recognize this. I'm new to sql...done most of my calcs via excel. Anyone know how to do this?
Post #484732
Jeff Moden
Jeff Moden
Posted Monday, April 14, 2008 8:08 PM
SSC-Dedicated
Group: General Forum Members
Last Login: Today @ 7:51 PM
Points: 32,910,
Visits: 26,800
SELECT CEILING(CAST (12.2 AS FLOAT))
--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 #484737
slkorf
slkorf
Posted Tuesday, April 15, 2008 6:10 AM
Forum Newbie
Group: General Forum Members
Last Login: Tuesday, March 10, 2009 8:47 AM
Points: 2,
Visits: 6
Thanks! This is exactly what I need.
Post #484916
Jeff Moden
Jeff Moden
Posted Tuesday, April 15, 2008 6:12 AM
SSC-Dedicated
Group: General Forum Members
Last Login: Today @ 7:51 PM
Points: 32,910,
Visits: 26,800
... perfect... thanks for the feedback.
--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 #484917
eiviery
eiviery
Posted Thursday, September 13, 2012 7:24 AM
Forum Newbie
Group: General Forum Members
Last Login: Thursday, September 13, 2012 7:20 AM
Points: 1,
Visits: 0
Thanks for the posts, this helped me also!
Post #1358541
« 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.