How do I query a date range based on dynamic start date? (1 Viewer)

G

glgold

Guest
I want to create a query that will pull all dates within a given month(Day, year, quarter, etc.). The intent is to input the start of the date range as a parameter and have the query dynamically determine the end of the date range and then display all records in that requested range.

I want to be able to query all transactions within a specific month and I would like the query to require a date to determine which month to start with.

I am thinking that it might be possible to to design a query that will require a [Start Date] parameter. From that start date it will calculate the end date and then display only the records that fall within the requested month.

Ultimately, I will use this query as a template to create additional queries to find sales records based on day, month, quarter, and year.


For Example
I have a 4 year history of records that I will be inputing into the database and I want to determine all records for the first month of 2002. But I want to be able to use the same query to find all records for March of 2003.
 

simongallop

Registered User.
Local time
Today, 19:27
Joined
Oct 17, 2000
Messages
611
Use a form with a textbox where you type in the date. In the criteria of the query use in the date field: Between Forms![Form Name]!ControlName AND (dateadd("m",1,Forms![Form Name]!ControlName)-1) This will give you a months worth of data.
 

Users who are viewing this thread

Top Bottom