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 |
|
marcoviy
Starting Member
6 Posts |
Posted - 2011-05-02 : 19:54:57
|
| Hello all,I have the following table:NAME VALUE METER 1 2850.398 METER 2 2576.066 I need a stored procedure which returns the sum of the values, but first ROUNDDOWNing the reading of EVERY meter (as done in Excel), But first the rounddown must be done (not AFTER the sum) because I will get a wrong result as explained below: 1. If I first add the values and then apply the RoundDown, the result will be (which is WRONG)TOTAL 5426.464 RoundDown -> 5426.46 2. If I first apply the RoundDown and afterwards I add the values, the result will be (which is what I NEED TO)NAME VALUE RoundDown() METER 1 2850.398 2850.39 METER 2 2576.066 2576.06 TOTAL 5426.45 Could you please help me with this problem? I've been looking for the RoundDown in SQL Server 2008, but I cannot find itThank you very much,Marco |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
|
|
marcoviy
Starting Member
6 Posts |
Posted - 2011-05-03 : 11:15:48
|
| Thanks khtan. That worked very well,Marco |
 |
|
|
|
|
|