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 |
|
CSK
Constraint Violating Yak Guru
489 Posts |
Posted - 2006-07-06 : 02:29:34
|
| Dear all,In the following Select statement returns 0 but this values is 0.1 Why it's return 0select 1/10ThanksKK |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-07-06 : 02:40:12
|
| Because of implicit conversion to int datatypeTry usingSelect 1/10.0MadhivananFailing to plan is Planning to fail |
 |
|
|
CSK
Constraint Violating Yak Guru
489 Posts |
Posted - 2006-07-06 : 02:42:15
|
| Yes It's workingHere What is the reason to pake an implicit conversion..?Thanks-- KK |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2006-07-06 : 02:42:40
|
because int divide by int is int. So 1 / 10 is 0 KH |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-07-06 : 02:46:46
|
| If both are of intergers and divisor is more than dividend then the result is 0MadhivananFailing to plan is Planning to fail |
 |
|
|
CSK
Constraint Violating Yak Guru
489 Posts |
Posted - 2006-07-06 : 02:51:34
|
| Thanks Gurus-- KK |
 |
|
|
|
|
|