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 |
|
IBoonZ
Yak Posting Veteran
53 Posts |
Posted - 2009-11-25 : 14:25:08
|
| HiI am trying something simple, but I am doing something wrong..I need a simple average of some int numbers, the output must be a number with 2 decimals like 2,5thenumber=1234so average is 2,5 (i get 2.00 as result) --> select thenumber = convert(decimal(10,2),(sum(thenumber )/count(thenumber ))) from uitleen |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
IBoonZ
Yak Posting Veteran
53 Posts |
Posted - 2009-11-25 : 14:40:59
|
| thank you :) but still get the 2 :/ |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
IBoonZ
Yak Posting Veteran
53 Posts |
Posted - 2009-11-25 : 15:35:34
|
| select thenumber = sum(thenumber)*1.0/(count(thenumber)*1.0) from uitleenworks :D |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
|
|
|
|
|