I tried to replicate the problem using SQL Server 2000 SP3, but I
could not.
create table TT
( Estimate decimal (12,4),
Sales decimal (12,4),
Summedsales decimal (12,4),
Derived AS (Estimate * (sales/Summedsales)))
INSERT TT (Estimate, Sales, Summedsales)
VALUES (149947.4395, 2054.80, 16225.87)
select * from TT
Estimate Sales Summedsales Derived
-------------- -------------- -------------- -------------------------
149947.4395 2054.8000 16225.8700 18988.93548910474376352
Perhaps you can create such an example that demonstrates the problem?
Roy Harvey
Beacon Falls, CT
On 20 Sep 2006 07:12:09 -0700, "SQLIdiot" <matt.karriker (AT) irwin (DOT) com>
wrote:
Quote:
I am using a derived column to calculate values for exploded sales
estimates. The formula is pretty simple (Estimate *
(sales/Summedsales)). Each of these numbers are decimal(12, 4). The
problem is that the derived column values are not the same if I just
did the math. An example (149947.4395 * (2054.80/16225.87)) =
18988.9355. The derived column returns 18983.3458. Roughly a $5
difference. I have tried a few different expressions in the derived
column task but the results never seem to be accurate. I wanted to see
if anyone else has run into a similar issue and how they may have
resolved this. Thanks. |