View previous topic :: View next topic |
Author |
Message |
vini Intermediate
Joined: 12 Jan 2004 Posts: 240 Topics: 48 Location: Maryland
|
Posted: Thu Nov 06, 2008 4:08 pm Post subject: Precision Loss When Using SUM( ) |
|
|
I have the following query where Db2 is returning me INTEGER values against the 3rd summed up column .........even though the column APPLIED_AMT being summed is a DECIMAL (9.2).
Kindly let me know how to have SUM return the exact precision of DECIMAL (9.2) instead of it rounding up the sums to integer values.
Code: |
SELECT X
,Y
,SUM ( CASE DBCR_CD WHEN '30'
THEN 0.00 - APPLIED_AMT
ELSE APPLIED_AMT END)
,COUNT(*)
FROM TABLE
GROUP BY X, Y HAVING
SUM ( CASE DBCR_CD WHEN '30'
THEN 0.00 - APPLIED_AMT
ELSE APPLIED_AMT END) <> 0 |
|
|
Back to top |
|
|
vini Intermediate
Joined: 12 Jan 2004 Posts: 240 Topics: 48 Location: Maryland
|
Posted: Thu Nov 06, 2008 4:25 pm Post subject: |
|
|
OK...strange ...I just found this works as expected in QMF but when I use QMF for Windows its the other story.
Does anyone know how to setup QMF for Windows to overcome this precision loss in the results ? |
|
Back to top |
|
|
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Fri Nov 07, 2008 3:11 am Post subject: |
|
|
possibly by specifying a form. i don't know, but just a guess. _________________ Dick Brenholtz
American living in Varel, Germany |
|
Back to top |
|
|
|
|