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 |
|
weipublic
Starting Member
19 Posts |
Posted - 2010-03-08 : 14:37:32
|
Hi All,For following, I wanted to get a result of '-163773.58', but I actually got '-163774'.Can any one help me?Thanks in advance!!!DECLARE @REAL1 REALSET @REAL1 = -163773.58DECLARE @REAL REALSET @REAL = @REAL1 PRINT @REAL |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2010-03-08 : 22:15:13
|
| Real and float datatypes are approximates, and you will encounter this kind of issue when you use them. If you require strict precision you must use a decimal or numeric datatype. |
 |
|
|
weipublic
Starting Member
19 Posts |
Posted - 2010-03-09 : 11:40:00
|
| Thank you so much for your help! |
 |
|
|
|
|
|