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

SETTING CRITERIA IN A QUERY

Status
Not open for further replies.

scott1891

MIS
Mar 18, 2002
12
US
I made a query, in my fiel named date I need to have it open by typing a range and generate info by it..example, when open the query I want it to prompt me to enter a beginning date and ending date(##/##/### to ##/##/####)which will give me all the info between the two dates. Any ideas?
 
You can do this by using a form with two text boxes. One has the start date and one the end date. Then put a command button on the form. Have the command button open the query and put in the criteria box of the query the criteria Between Forms!formname!startdate and forms!formname!enddate.

If you dont want to use a form, simply put the criteria in and when you open the query, you'll be prompted for the dates.
 
I think what your asking for is this .. ..

In the query place the following in the criteria line for the date field
Between [Enter start date] And [Enter end date]

When the query runs it will throw up a box containing the label [Enter start date] so you can enter the info and click okay. Then it throws up the second etc then it will select data with date field between those limits.

SNAG - You cant protect your system from stupid users who put an earlier date in the second box !!!!
Use a customer dialog box as discussed in the previous answer if this problem is a serious concern.

G LS
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top