Ted Roche wrote:
> On Dec 10, 2007 3:02 PM, MB Software Solutions
> <[EMAIL PROTECTED]> wrote:
>   
>> I added the NVL because without it, the result could be .NULL. and the
>> array doesn't get created.  I ask this question because the idea of an
>> NVL around a SQL SUM seems odd to me, like it wouldn't evaluate in the
>> proper sequence perhaps.
>>
>>     
>
> Do you want the sum of any column containing a NULL to be zero, or do
> you want the sum of all the non-NULLs in the column, with NULL coerced
> to zero? Your example does the first. Placing the SUM outside the NVL
> does the latter.
>
>
>   
The problem I'm encountering is that when there are NO matching records, 
the array variable is left at .F.  I can get around this by initializing 
the array variables to 0; it's just that I was thinking the SUM would 
return 0.  My mistake!  I guess initializing them to 0 is better 
practice anyway?

Thanks, TR, Rick, and Steve.

-- 
Michael J. Babcock, MCP
MB Software Solutions, LLC
http://mbsoftwaresolutions.com
http://fabmate.com
"Work smarter, not harder, with MBSS custom software solutions!"



_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to