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 |
|
annamaria
Starting Member
30 Posts |
Posted - 2007-05-26 : 14:07:34
|
| review |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2007-05-26 : 14:15:52
|
| post some sample data to help us understand what you're asking._______________________________________________Causing trouble since 1980blog: http://weblogs.sqlteam.com/mladenp |
 |
|
|
PSamsig
Constraint Violating Yak Guru
384 Posts |
Posted - 2007-05-27 : 05:24:31
|
| I think your server is doing a swell job, it must be your calculator who needs a checkup:4,866 /360 * 30 = 0,4055 ~ 0,406if you don't belive me, then do it in integers:48660 * 300000 / 3600000 = 4055-- If you give someone a program, you will frustrate them for a day; if you teach them how to program, you will frustrate them for a lifetime. |
 |
|
|
pbguy
Constraint Violating Yak Guru
319 Posts |
Posted - 2007-05-27 : 23:58:20
|
| try like thisselect round(round(4866.0 / 360.0 * 30.0, 2),0) |
 |
|
|
Jeff Moden
Aged Yak Warrior
652 Posts |
Posted - 2007-05-28 : 00:15:09
|
| >>it doesn't round 0,4055 but 0,4054999998.That's because you are using the FLOAT data type. You must either compensate for using it or use another datatype like maybe DECIMAL with the appropriate scale and precision.--Jeff Moden |
 |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2007-05-28 : 11:12:31
|
| because float isn't a exact type. it hold approximates.look in books online for better understanding._______________________________________________Causing trouble since 1980blog: http://weblogs.sqlteam.com/mladenp |
 |
|
|
|
|
|