Re: Informix SQL - ACE question....
Posted in 2000
We do this all the time and it requires no fancy select statements and it is easy to maintain and works great- For each GROUP OF that you require per COLUMN, create a separate variable. Set all the variables to 0 on first page header or where appropriate in your report. ONLY print the variable ONCE in the appropriate group. Let me know if this works for you. Mark Caton wrote: > I am working on an ACE report in Informix SQL and have hit a wall... > > On each row I'm outputing three columns of data each from a temp table and a > fourth column which is the sum of the first three. Because one or more of > the first three may be NULL I had to assign a variable for each and assign > it the value "0" when NULL to maintain an appropriate sum in the fourth > column. So far so good. I then have an "after group of" statement that > attempts to sum the fourth column from above like so: > > after group of * > print column 15, group total of * using "$$$$,$$$,$$$.&&" > > the results of this approach have not been good- the totals are not > calculating correctly. > > The manual says about ACE aggregates such as "total": "Aggregates produce > unpredictable results when expr1 or expr2 contains user-defined variables." > > Of course I am using variables in my "group total of" statement. I can't > seem to avoid their use to get the other columns to sum correctly. > > Any ideas? > > Mark Caton