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
 SQL Server Development (2000)
 Convert

Author  Topic 

rajdaksha
Aged Yak Warrior

595 Posts

Posted - 2009-06-30 : 06:36:36
hi

I have table data like this
1.14011E-05
0.001956445
0.001962741
0.002209971
0.002436673
0.002676951
0.007141664
0.010639513
0.012326124
0.012339608
0.013494415
0.015439458
But i want to convert the data like this
0%
0%
0%
0%
0%
0%
1%
1%
1%
1%
1%
2%
please help on this

by
raj...:)

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2009-06-30 : 06:41:18
multiply by 100 and convert to integer ?

convert(int, col * 100)



KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

rajdaksha
Aged Yak Warrior

595 Posts

Posted - 2009-06-30 : 06:46:56
Thanks
Go to Top of Page

rajdaksha
Aged Yak Warrior

595 Posts

Posted - 2009-06-30 : 06:51:59
Hi
I did the same operation in excel. but i got differen record set from excel and sql server which u have mention Convert( int, col *100)
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2009-06-30 : 06:57:35
if you are performing the formatting in excel you should leave the value as it is and don't convert it, but format as PERCENTAGE in excel.


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

rajdaksha
Aged Yak Warrior

595 Posts

Posted - 2009-06-30 : 07:10:02
hi
If i show the values from SQL SERVER the client will ask the format whatever in excel show's i hope you know very well about the client thoughts.
Go to Top of Page

rajdaksha
Aged Yak Warrior

595 Posts

Posted - 2009-06-30 : 07:11:08
I perofrming in sql server only what i did is convert the process excel to SQL SERVER
Go to Top of Page

Jeff Moden
Aged Yak Warrior

652 Posts

Posted - 2009-07-19 : 20:59:50
SELECT STR(0.007141664*100,3,0)+'%'

--Jeff Moden
"Your lack of planning DOES constitute an emergency on my part... SO PLAN BETTER! "
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row"

Go to Top of Page
   

- Advertisement -