Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ROUND Function

Status
Not open for further replies.

2J

Programmer
Nov 23, 1999
8
AU
Does anyone know how SQL Server chooses to round when the last digit after the decimal point is 5. I've used this function in a stored procedure and two records with the same value (0.265) get returned differently, 0.26 and 0.27. At this point my only solution is to do the rounding in Crystal Reports and not from SQL Server directly. I would love to know why this happens and if there is a another solution.<br>
<br>
<br>
Thanks<br>
2J
 
I found the solution to the problem on another forum.<br>
<br>
<br>
Using the decimal datatype instead of float fixes the problem because float only aproximates values. For complex mathematical calculations decimal, money and numeric datatypes are mre appropriate
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top