Selecting data between two dates

Robert C

Registered User.
Local time
Today, 18:04
Joined
Mar 27, 2000
Messages
88
I have a database which records time spent on various projects and I would like to be able to calculate the time spent on any particular project between two selected dates. The report and the query behind it already works to display the time accrued on all the dates of a project, but I want to be able to break it down to small ranges of dates

I have a form on which the user selects the start date and the end date. How can I apply this calculated information as a criteria in a query so that I can produce a report with the relevant information on it.

I already have the report and the date selection form designed. The dates selected go into two unbound fields which have a date format.

I hope someone can help me.

Rob
 
In the criteria row of the date field in the query:

Between Forms!FormName.StartDate And Forms!FormName.EndDate
 
In your query under the "Date" field criteria you will want to reference the unbound fields on your form..... something like.. Between [Forms]![frmFormName]![txtStartDate] And [Forms]![frmFormName]![txtEndDate]
 
Thanks guys.

Sorry to sound dim, but how do I create a field in my query into which the criteria you descrbe can be placed, and in what format should this field be as it is a calculation of the amount of time accrued between two dates.

I am a bit confused.

Cheers

Rob
 
You said you already had a working query that returned all records. Find the field that has the date you want to filter on, and in the "Criteria" row under that field paste in the expression we both posted, changing the form and control names as appropriate.
 
Paul

Thanks a million - that works a treat.

Cheers

Rob
 

Users who are viewing this thread

Back
Top Bottom