This MSAccess tutorial explains how to create a query that accepts a start date and an end date as parameters in Access 2003 (with screenshots and step-by-step instructions).

Question: In Microsoft Access 2007/XP/2000/97, I’m trying to run a query based on a date. When the query opens, I would like some type of window prompting for the user to enter a “start” date and an “end” date. How can I do this?

Answer: You can create a parameter query that prompts for both a “start” date and an “end” date.

To do this, first create your query.

Microsoft Access

Then enter your “start” date and “end” date parameters. Parameters should be enclosed in [] brackets as follows:

>=[Start Date] And <=[End Date]

This will create a parameter called [Start Date] and a parameter called [End Date]. So that only those records from the Orders table will be returned where the OrderDate field is between these two dates.

Next, you probably want to ensure that the user enters a valid date in these two parameters. To do this, select Parameters under the Query menu.

Microsoft Access

When the Query Parameters window appears, enter the two parameters [Start Date] and [End Date], and select Date/Time as the data type. Click on the OK button.

Microsoft Access

Now, when you run the query, you will be prompted to enter the “start” date.

Microsoft Access

Then prompted to enter the “end” date.

Microsoft Access

Your query will then only return the records where the OrderDate is between these two values.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s