Parameter Queries

  • Thread starter Thread starter goodgirlinterrupted
  • Start date 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..
 
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().
 
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.
 
Back
Top