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

Using a Query - Want to find records between a set of dates 1

Status
Not open for further replies.

usfpjc

MIS
Jan 1, 2002
27
US
Let's say that I would like to find records that fall between for example between 01/01/01 and 03/30/01 using a query, what type of technique should I use by typing in the query criteria section some type or argument.

Example: [Type date ranges:] between xx/xx/xx and xx/xx/xx

I tried this way but it only works with an expression builder but not with the criteria format.
 
At then end of your query, add a WHERE clause.

WHERE [tblMytable]![MyDate] >= [Forms]![MyForm]![MyDate]
OR [tblMytable]![MyDate] <= [Forms]![MyForm]![MyDate];

You can change the >= and <= to > and < if you don't want the particular dates included.
 
usfpjc,
You need to add brackets to the Between Operator.
In the criteria section of your date field enter;
Between [Enter a date] and [Enter end date]
When you run the query a &quot;Enter Parameter Value&quot; box will appear for Start Date and End Date.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top