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 |
|
TMDOSS
Starting Member
33 Posts |
Posted - 2009-11-20 : 14:04:03
|
| I'm computing values from 4 int colums (the sum is 465)if I divide the sum by 60 I should get 7.75, but i always get 7. Pl help |
|
|
TG
Master Smack Fu Yak Hacker
6065 Posts |
Posted - 2009-11-20 : 14:10:18
|
| quick fix is to devide by 60.0you need to make the denominator more preciseBe One with the OptimizerTG |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
TG
Master Smack Fu Yak Hacker
6065 Posts |
Posted - 2009-11-20 : 15:24:41
|
| actually he said sum (not product) so:DECLARE @a int, @b int, @c int, @d intSELECT @a = 462, @b = 1, @c = 1, @d = 1SELECT (@a+@b+@c+@d) / 60.0but how about 465, 1, 1, 1Be One with the OptimizerTG |
 |
|
|
X002548
Not Just a Number
15586 Posts |
Posted - 2009-11-20 : 15:33:11
|
quote: Originally posted by TG actually he said sum (not product) so:DECLARE @a int, @b int, @c int, @d intSELECT @a = 462, @b = 1, @c = 1, @d = 1SELECT (@a+@b+@c+@d) / 60.0but how about 465, 1, 1, 1Be One with the OptimizerTG
Go get some crab cakes and have a Philips Bloody MaryBrett8-)Hint: Want your questions answered fast? Follow the direction in this linkhttp://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspxAdd yourself!http://www.frappr.com/sqlteam |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
|
|
|
|
|