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 |
rajesh_
Starting Member
8 Posts |
Posted - 2007-06-12 : 02:51:44
|
Hi,When i run " select (105/43200) " in Query analyzer it is printing 0 . But actual output should be 0.002.I used CAST. But no luck its still printing 0. Please suggest me. |
|
pbguy
Constraint Violating Yak Guru
319 Posts |
Posted - 2007-06-12 : 02:55:41
|
select (105.0/43200.0) and round it to your no. of decimal--------------------------------------------------S.Ahamed |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-06-12 : 09:33:01
|
It is becuase by default it is converted to int datatypeYou should change one of the values to float by multiplying it by 1.0If you use variables in place of actual values, you can doSelect 1.0*@var/@var2MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|