query based on date ?

P

pakerly

I've got a table and I want to display stuff from the table with this
query, but I want the query to prompt for a begin date and end date
and only display records between these dates...is this possible?

Basically I want to build a report off of this query, so whenever the
user goes to run the report they will be asked to enter a begin date,
and an end date and it will only display records in that range. Yes,
my table does have a date field.
 
K

Ken Snell MVP

Yes, by using parameters in the query:

PARAMETERS [Enter start date (m/d/yyyy):] Date,
[Enter end date (m/d/yyyy):] Date;
SELECT *
FROM YourTableName
WHERE DateFieldName Between
[Enter start date (m/d/yyyy):] And
[Enter end date (m/d/yyyy):];
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top