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 |
|
zubair
Yak Posting Veteran
67 Posts |
Posted - 2009-12-14 : 17:04:44
|
| Hi I have the following....select (convert(float,(50 - 40 / 40))) as testwhen i output the value it is 49.0. Can anyone explain to me why its not 0.25 as thats what the value should be after doing the calculation!?Thanks |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
zubair
Yak Posting Veteran
67 Posts |
Posted - 2009-12-14 : 17:37:46
|
| Thanks for the reply... just another thing.. for the following select (50 - 70)*100/70 as testI get an answer of -28However hen i do the calculation on a calculator i get a value of -28.57 rounded to 2 decimal places. Is there a way to get the decimal values as well? |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
vijayisonly
Master Smack Fu Yak Hacker
1836 Posts |
Posted - 2009-12-14 : 17:47:07
|
| This will be a good read..http://sqlblogcasts.com/blogs/madhivanan/archive/2008/01/16/beware-of-implicit-conversions.aspx |
 |
|
|
zubair
Yak Posting Veteran
67 Posts |
Posted - 2009-12-14 : 17:50:17
|
| Thanks Tara. did the trick! |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
|
|
|