Query Help

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a query that pulls alot of data with many dates. I would like to set
the querey to prompt for a range: enter Start date- then enter End date. Once
those dates have been inputted the query just shows the date range entered.
Help would be much appreciated.
 
If you're using the query grid, put the following in the Criteria cell under
the Date field:

BETWEEN [Start Date] AND [End Date]

When you run the query, you'll be prompted to enter a Start Date. Reply, and
you'll be prompted to enter an End Date. Once you've provided that, you'll
get the query back with only the appropriate rows.

Another option is to create a form that has two text boxes on it. Assume you
name that form frmPrompts and the text boxes txtStart and txtEnd. You'd
change what I gave above to

BETWEEN Forms!frmPrompts!txtStart AND Forms!frmPrompts!txtEnd

Note the form must be open before you run the query: if it isn't, the form
will not be opened for you, but you'll receive sequential prompts like
above.
 
Great Thanks.

Douglas J. Steele said:
If you're using the query grid, put the following in the Criteria cell under
the Date field:

BETWEEN [Start Date] AND [End Date]

When you run the query, you'll be prompted to enter a Start Date. Reply, and
you'll be prompted to enter an End Date. Once you've provided that, you'll
get the query back with only the appropriate rows.

Another option is to create a form that has two text boxes on it. Assume you
name that form frmPrompts and the text boxes txtStart and txtEnd. You'd
change what I gave above to

BETWEEN Forms!frmPrompts!txtStart AND Forms!frmPrompts!txtEnd

Note the form must be open before you run the query: if it isn't, the form
will not be opened for you, but you'll receive sequential prompts like
above.


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


HELP said:
I have a query that pulls alot of data with many dates. I would like to set
the querey to prompt for a range: enter Start date- then enter End date.
Once
those dates have been inputted the query just shows the date range
entered.
Help would be much appreciated.
 
Back
Top