View Full Version : Report to show only certain records without altering query


Len
01-10-2004, 03:58 PM
Can someone tell me if I can filter a report by adding an expression or a "print between certain date ranges" statement in the Sorting/Grouping Box?

The record source for the report query is a Select query from a Union query that shows receipts and shipments and the report has a running balance on quantities for the items that I added from an unbound text box .

When I add date parameters to the query it affects the running balance of the report. What I want to do is have the report filtered by "from and to" dates so the query runs in full but only shows the records I choose on the printed report.

Sorry if this does not make much sense by it is the only way I can think of to explain it.

Thanks.
Len

Len Boorman
01-11-2004, 12:18 PM
How about adding a parameter in the select query as below

between[Please enter Start Date] and [Please enter End Date]

When you fire the report generation there will be prompts come up on the screen asking the user for dates.

Does this help

Len

Len
01-11-2004, 01:23 PM
Dear Len,
Thanks for the reply. I have done this already. When I limit the records at the query level it screws up the running balance (the start number is not the same so all running balance numbers after that are off)

Think of it as an Excel File and I want to hide the rows from the previous month which doesn't effect the Item Balance column.

Make any sense???

Rich
01-11-2004, 03:02 PM
Use the Where clause of the OpenReport method

Len
01-11-2004, 05:22 PM
Thanks for the reply.
Can you please give me more detail on how to configure the where clause? I have not had much luck with this sort of thing
Thanks.
Len

Pat Hartman
01-11-2004, 07:43 PM
Your report needs to be based on a union query. The first query summarizes all the data prior to the begin date of the date range, the second query selects detail records from the date range. The union of the two queries contains all the data needed to produce the report. Any filtering will only bring in the detail records from that period and will ignore all the rest, that's why you need the union.