Re: GROUP SUM with WHERE in REPORT
Posted in 1996
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL
John Prideaux wrote: > > For this example, assume that all variables are declared correctly > and sensibly and that this code exists in an AFTER GROUP clause of > a report. I have verified that at the point in time where the > GROUP SUM is executed that curr_year = 1995 and that rows with > rpt.data_year = 1995 have been passed to the report. > > for i = 1 to num_years > let curr_year = year_array[i] > let rpt.sub_line_year = curr_year > let turn_rec.begin_tons = (group sum(rpt.begin_tons) > where (rpt.data_year = curr_year)) > .... > end for > > This code places a null into turn_rec.begin_tons. > If I replace the last line with > where (rpt.data_year = 1995) > I get correct output. > > Is this a bug or a feature? I can restructure my report to get > the behavior I need, but I am curious. > > John Prideaux > alastl@ix.netcom.com John, I have run into this too. When we dialed into the Informix bug database, we found it listed as a bug. Considering Informix won't be updating 4GL anymore in the near future...Consider it a feature now.