Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
mgarret
Starting Member
14 Posts |
Posted - 2011-09-11 : 22:38:28
|
| Hi All-Any help is greatly appreciated. All i am trying to do is change the format of a number generated by a function. i am multiplying count(*) by .35 and instead of getting a number like this 36.777777777 I want to get a rounded whole number so like this 37. select distinct count(*) as Initial_Cohort "Cohort", count(*) * .35 as FY12Target <----- right here is where i need the formatfrom CHILDTABLE; |
|
|
flamblaster
Constraint Violating Yak Guru
384 Posts |
Posted - 2011-09-12 : 00:03:47
|
| Hi M,Try:select distinct count(*) as Initial_Cohort "Cohort", ROUND(count(*) * .35,0)from CHILDTABLE; |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-09-12 : 00:52:48
|
| do you want to always get next whole number or just round it? if former, the earlier suggestion would work. if latter, you need to use CIELING() function insteadseeSELECT ROUND(36.3333333333 ,0),CEILING(36.3333333 )------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|