Parameter Queries

  • Thread starter goodgirlinterrupted
  • Start date
G

goodgirlinterrupted

When you put in the Enter criteria for a query so that the user will have to
enter information first, such as entering a start date and then a finish
date, how do you then get the query to show all records that fall either on
or between those two entries? I can't seem to figure it out for the life of
me.

Thank you for the help it is very much appreciated and will bring much
relief to my stress level from fighting with the formula's..
 
D

Duane Hookom

To add a criteria/filter to a query, you enter the appropriate parameters
under the field/column in the Criteria row.
IMO, parameter prompts are never appropriate user interface. Consider
reading http://www.tek-tips.com/faqs.cfm?fid=6763. Use controls on forms for
all user interaction. Feel free to use prompts for yes/no responses using
MsgBox().
 
J

John W. Vinson

When you put in the Enter criteria for a query so that the user will have to
enter information first, such as entering a start date and then a finish
date, how do you then get the query to show all records that fall either on
or between those two entries? I can't seem to figure it out for the life of
me.

Thank you for the help it is very much appreciated and will bring much
relief to my stress level from fighting with the formula's..

I fully agree with Duane, but to directly answer your question, a criterion of
= [Enter start date:] AND < [Enter end date:] + 1

will find all records from midnight at the beginning of the start date up to
midnight at the *end* of the end date (the +1 ensures that).
= [Forms]![YourFormName]![txtStartDate] AND < DateAdd("d", 1, [Forms]![YourFormName]![txtEndDate])

does the same using a form to request the criteria.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top