A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Parameter Queries



 
 
Thread Tools Display Modes
  #1  
Old March 15th, 2010, 03:02 AM posted to microsoft.public.access.queries
goodgirlinterrupted
external usenet poster
 
Posts: 3
Default Parameter Queries

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..
  #2  
Old March 15th, 2010, 04:08 AM posted to microsoft.public.access.queries
Duane Hookom[_4_]
external usenet poster
 
Posts: 316
Default Parameter Queries

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().

--
Duane Hookom
MS Access MVP



"goodgirlinterrupted" wrote
in message ...
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..


  #3  
Old March 15th, 2010, 06:38 AM posted to microsoft.public.access.queries
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Parameter Queries

On Sun, 14 Mar 2010 20:02:01 -0700, goodgirlinterrupted
wrote:

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.
--

John W. Vinson [MVP]
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:26 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.