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
 SQL Server 2000 Forums
 Transact-SQL (2000)
 converting decimal

Author  Topic 

kemi2299
Starting Member

41 Posts

Posted - 2008-04-04 : 05:12:48
I have 2 values & want to return the decimal as a percentage
update pci.IPDQ_non_elective_admission_Mth
set pcent_ethnic = 100.0*sum_ethnic /total_adms,
pcent_NHS_Num = 100.0 * sum_NHS_Num/total_adms ,

I get normall 33.333333333

How do I get 33.0

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2008-04-04 : 05:24:43
Use ROUND() function

update pci.IPDQ_non_elective_admission_Mth
set pcent_ethnic = Round(100.0*sum_ethnic /total_adms,0),
pcent_NHS_Num = Round(100.0 * sum_NHS_Num/total_adms,0)


Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

kemi2299
Starting Member

41 Posts

Posted - 2008-04-04 : 06:06:11
thanks, it worked
Go to Top of Page
   

- Advertisement -