Re: Aggregate SUM
Posted in 1999
David Tucker wrote: > > when using the aggregste function (sum) in a report.... > > is there a way to place a conditional statemment within > (i.e.) > sum(col1 where col1 is not null) I've been watching the replies to this awaiting info on exactly what products, versions, or even if they are Informix reports you are using. So assuming you are using 4GL, yes you can use a WHERE clause with SUM, something like: PRINT GROUP SUM(my_col) WHERE my_col IS NOT NULL This is not to be confused with the SQL SUM function though, which as someone pointed out, ignores NULL values anyway. x-) Hope that helps, -- Mark. +----------------------------------------------------------+-----------+ |Mark D. Stock - Informix SA http://www.informix.com |//////// /| |mailto:mdstock@informix.com http://www.informix.com/idn |///// / //| |http://www.iiug.org +-----------------------------------+//// / ///| | Tel: +27 11 807 0313 |If it's slow, the users complain. |/// / ////| | Fax: +27 838250 2325 |If it's fast, the users keep quiet.|// / /////| |Cell: +27 83 250 2325 |Therefore, "No news: travels fast"!|/ ////////| +----------------------+-----------------------------------+-----------+