Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Round up the values Expand / Collapse
Author
Message
Posted Tuesday, October 22, 2013 9:59 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Wednesday, April 16, 2014 5:54 AM
Points: 172, Visits: 450
Hi All,

I want to round decimals to nearest whole number.

eg. if value is equal to or greater than .5 then it should display next whole number.

eg. 1) if value is 10.50 then it should be 11
2) if value is 10.49 then it should be 10

thanks
Abhas.
Post #1507231
Posted Tuesday, October 22, 2013 10:20 AM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Thursday, April 17, 2014 9:10 AM
Points: 551, Visits: 3,165
SELECT CONVERT(INT,ROUND(10.50,0))
SELECT CONVERT(INT,ROUND(10.49,0))
Post #1507235
Posted Tuesday, October 22, 2013 4:41 PM
SSChasing Mays

SSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing Mays

Group: General Forum Members
Last Login: Sunday, November 17, 2013 11:53 AM
Points: 623, Visits: 237

SELECT CONVERT(INT,ROUND(<YourColumnName>,0)) FROM <yourtable>

Post #1507418
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse