Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to print a report between certain dates?

Status
Not open for further replies.

sandingdude

IS-IT--Management
Jun 26, 2002
109
US
I have a table with a bunch of dates. I need to print a report lets say with the date range from 2/1/03 to 5/1/03 and I need all those records displayed. Do I need to create a query first? Please help. Thanks.
 
Yes, you need to create a saved query that selects the records according to the prompted dates. This query should be identified as the Recordsource for your Report instead of the Table.

Here is a sample query to help you setup your query:
Select A.*
FROM tblYourTableName as A
WHERE A.DateField Between [Enter BeginDate(mm/dd/yyyy): ] and [Enter EndDate(mm/dd/yyyy): ];

Post back with any questions.



Bob Scriver
Want the best answers? See FAQ181-2886
Nobody believes the official spokesman... but everybody trusts an unidentified source.
Author, Bagdad Bob???

 
Yes.

Create your query.

Include all the fields you want displayed on the report in your query.

In the Date field down in the criteria section, enter something like this:

Between [Enter Begin Date] and [Enter End Date]

This will cause your program to prompt for a begin date and ending date and only pull the data for the date range you specify.

If you would rather enter your date range via a form, create 2 boxes on your form.

Give the text boxes applicable names like BeginDate and EndDate.

In your query criteria, instead of using [Enter Begin Date] you are going to specify for your query to look at the values on the form.

In the criteria section of the query enter something like this:

Between [Forms]![YourFormName]![BeginDate].value and [Forms]![YourFormName]![EndDate].value

Remember to set the record source of your report to the query you've just created.

If you have any questions let me know.

Hope this helps you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top