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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query between dates

Status
Not open for further replies.

Rmcta

Technical User
Nov 1, 2002
478
US
In my travellers database I have fields Country, FromDate, ToDate.
Users will use a form to select the country from a combo box and then two text boxes to enter FromDate and ToDate.
I need to say:
Give me a report for the selected country for all the people who were there between certain dates.
How do I do that?
Thank you

 
I would write a query and base the report on the query.

In the query prompt for the input data from the form by using criteria such as
[Forms]![frmFormName]![cboCountry] for the country

and

Between [Forms]![frmFormName]![txtStartDate] And [Forms]![frmFormName]![txtEndDate] for the date range.

The easiest way to do this is to right click the criteria in the query and choose "Build". Select the form field names from the loaded form.

ps. You may want to set default dates for the users such as Today() for the end date and "Today() - 180" for the start date.

Good luck!

John
 
Thank you John. I will try that.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top