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 |
|
hspatil31
Posting Yak Master
182 Posts |
Posted - 2012-02-07 : 06:28:46
|
| Hello All,I am tryin following SQL statement but I am not getting proper output,SELECT (200*100)/400000I am getting output 0 but It should shows 0.05.Can anybody please tell me how to resolve this issue ?Thanks and Regard'sHarish Patil |
|
|
sunitabeck
Master Smack Fu Yak Hacker
5155 Posts |
Posted - 2012-02-07 : 06:48:23
|
It is because of integer division. Force to decimal by changing at least one of those to decimal - for example:SELECT (200*100.00)/400000 OrSELECT (200*100*1.0)/400000 |
 |
|
|
|
|
|