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.

 All Forums
 SQL Server 2012 Forums
 Transact-SQL (2012)
 Float Error

Author  Topic 

samir.first
Starting Member

34 Posts

Posted - 2014-04-26 : 04:03:02
SELECT ItemID,CurrentQuantity ,ComputedCurrentQuantity
SUM(AddQuantity -ExQuantity ) OVER ( PARTITION BY ItemID ORDER BY FullDate ROWS UNBOUNDED PRECEDING) FROM SC_ItemsCurrentValues
all data type is float
CurrentQuantity is value insert and ComputedCurrentQuantity is recalculate this value
the Result is
CurrentQuantity ComputedCurrentQuantity
60.62 60.62
but when add column CurrentQuantity - ComputedCurrentQuantity
the Result is
CurrentQuantity ComputedCurrentQuantity Deferent
60.62 60.62 -9.09494701772928E-13
Please I need Solved it

nagino
Yak Posting Veteran

75 Posts

Posted - 2014-04-27 : 20:15:18
by design
Float type is floating-point number
use Decimal type

-------------------------------------
From Japan
Sorry, my English ability is limited.
Go to Top of Page
   

- Advertisement -