Producing reports from code

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi
I have a form that lists a dozen or so reports. When criteria is specified
in filter fields provided, a WHERE clause is written so that when the report
opens, only the filtered data is shown. It all works fine but I have just
discovered a problem.

A couple of my queries for the underlying reports are Aggregate queries.
They show a total count of transactions per customer. I want to filter on a
date range but if I include the date as Group By, the transactions are no
longer counted because the dates are different. If I use WHERE for the date
and leave the criteria blank, the field doesn't appear in the query's output.
I really want to generate the WHERE clause for all reports in the same
manner. Is there a way I can avoid having different code for different
reports in this scenario?

I hope this makes sense. Thanks in advance.
 
A couple of my queries for the underlying reports are Aggregate queries.
They show a total count of transactions per customer. I want to filter on a
date range but if I include the date as Group By, the transactions are no
longer counted because the dates are different. If I use WHERE for the date
and leave the criteria blank, the field doesn't appear in the query's output.
I really want to generate the WHERE clause for all reports in the same
manner. Is there a way I can avoid having different code for different
reports in this scenario?

I'd suggest including the date field in the Where clause, and ALSO as
a visible field in the query (using First as the aggregate function,
perhaps, if it doesn't matter which date appears on the report).

John W. Vinson[MVP]
 
Back
Top