× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Chuck,

Thanks for the pages from the manual. Now I've got to study them and see if I can understand the rules. (I started out by searching the PDF SQL Reference for "division" and got a lot of hits... And I can't claim to have read all of its 1000+ pages so "arithmetic" didn't come to mind.)

Set option DECRESULT is interesting, but it has to be "compiled" so it doesn't work in client applications, which is where we primarily do these kind of ad-hoc queries. I suppose it might work in a UDF written in SPL.

I guess going forward, if in doubt I'll specify the scale and precision on a SUM statement.

Cheers,

Sam



On 3/17/2013 11:55 PM, CRPence wrote:
On 17 Mar 2013 17:24, Sam_L wrote:
Boss was trying to sum two decimal fields and get the percentage
of the sums. It looked easy, but the percentage always came out
as zero.

http://pic.dhe.ibm.com/infocenter/iseries/v7r1m0/topic/db2/rbafzdecarithmetic.htm

_

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.