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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 ROUND

Author  Topic 

laddu
Constraint Violating Yak Guru

332 Posts

Posted - 2011-08-04 : 14:11:50
Hi,

I am trying to use round here.
Below script output is 13.77777. but I need 13.7

Can you help me to ROUND

Select
avg(isnull(TotalMessages,0)) as TotalAvgMessagesPerPatient
from #temp_patients

TotalMessages DECIMAL (datatype)

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2011-08-04 : 14:16:32
I assume you want to "round down" or truncate to one decimal place.
Select	
round(avg(isnull(TotalMessages,0)),1,1) as TotalAvgMessagesPerPatient
from #temp_patients
Go to Top of Page
   

- Advertisement -