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 |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2005-10-27 : 08:00:55
|
| anuraj writes "HaiI am facing a problem like belowSELECT CONVERT(FLOAT,1.0/15.0) gives a result like this6.6666000000000003E-2But I want the result like this0.066666666666666666666666666666667 Please help methanks and regards anurajSQL Server : 7.0 MS Windows 2000, SP 4.0" |
|
|
chiragkhabaria
Master Smack Fu Yak Hacker
1907 Posts |
Posted - 2005-10-27 : 09:14:32
|
| Hope this helps you .. Select Cast(1.0/15.0 As Numeric(10,10) )Complicated things can be done by simple thinking |
 |
|
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
Posted - 2005-10-27 : 09:47:41
|
| This should do it:select Result= convert(float,1.0)/convert(float,15.0)Result -----------------------------6.6666666666666666E-2(1 row(s) affected)CODO ERGO SUM |
 |
|
|
Frank Kalis
Constraint Violating Yak Guru
413 Posts |
Posted - 2005-10-28 : 03:14:45
|
Probably as close as one can get without going the right direction and use the client for such formatting issues, you might doselect STR(convert(float,1.0)/convert(float,15.0),18,18) ------------------ 0.0666666666666667(1 row(s) affected) --Frank KalisMicrosoft SQL Server MVPhttp://www.insidesql.deHeute schon geblogged? http://www.insidesql.de/blogsIch unterstütze PASS Deutschland e.V. (http://www.sqlpass.de) |
 |
|
|
|
|
|