Help w/ query for new user

  • Thread starter Thread starter Brian
  • Start date Start date
B

Brian

I'm new to learning Access and am having trouble with
designing a query (I'm teaching myself). Here's my
dilemma. I have created a database of our digital logging
recorder tapes. In the table I have fields for tape
number, start date, and end date. Is it possible to
design a query that would search for that date where it
would be found within that start and end date range and
give me that corresponding tape number? Any suggestions
on how best to make this happen? Thanks in advance for
any help anyone can give to a newbie.
 
Brian

Take a look in Access HELP for the "Between xxx And yyy" expression. You'll
put the date range in for xxx and yyy. If you want date ranges to search
for on both startdate and enddate, you'll do it twice. Example:

Between 1/1/2003 And 2/1/2003

(Note U.S. date format)

Good luck

Jeff Boyce
<Access MVP>
 
Yes, it is possible. ONE way to do it.

DateYouAreSearchingFor Between StartDate and EndDate

In the query grid
Field: [Search For Date]
Table: (Leave blank)
Criteria: Between [TableName].[StartDate] and [TableName].[EndDate]

In SQL that would look like

Parameters [Enter Search Date] DateTime;
SELECT T.TapeNumber
FROM TableName as T
WHERE [Enter Search Date:] T.[StartDate] and T.[EndDate]

When you run the query, you will be asked to enter a date. If you enter 9/1/03,
this should return all TapeNumbers that have a start date on or before 9/1/03
and an End date that is On or after 9/1/03.
 
Back
Top