View Full Version : Report Date range criteria


maestro83
04-13-2010, 04:11 PM
Hi,

I have a table that has an event field and several date/time fields eg:


Event-----Date1---------Date2---------Date3 etc
Expo------01/04/2010----24/03/2010----10/03/2010
Expo------01/03/2010----24/02/2010----10/02/2010
Expo------01/02/2010----24/01/2010----10/01/2010
Expo------01/01/2010----24/12/2009----10/12/2009

I followed these steps from another website:



Create a query to use as the RecordSource of your report.
In query design view, in the Criteria row under your date field, enter: >= [StartDate] < [EndDate] + 1
Choose Parameters from the Query menu, and declare two parameters of type Date/Time: StartDate Date/Time EndDate Date/Time
To display the limiting dates on the report, open your report in Design View, and add two text boxes to the Report Header section. Set their ControlSource property to =StartDate and =EndDate respectively.

I only put the criteria under the 1 field which I want the report based on. When I run the report it prompts me to enter the StartDate and EndDate correctly, but displays a full un-filtered report with dates outside of the range.

I noticed if I look at the query after running the report it adds another field to it and removes the criteria from the field I placed it in:


Field ([tbl_Events].[OpeningNight])>=[StartDate]
Table
Sort
Show
Criteria <[EndDate]+1


Any ideas how I can fix this would be greatly appreciated.

Thanks
Matt

maestro83
04-13-2010, 04:43 PM
I came to the conclussion that the report was forgetting the parameters and so implemented a form to pass the parameters which I found an example here: http://www.access-programmers.co.uk/forums/showthread.php?t=173661

Now, because there are soo many records with so many possibilities being within my date range over several fields, is there a way that I could have the report highlight fields that ARE witthin the range and show null in the fields that ARE NOT with in the range.

Thanks
Matt