ACC: How to Use Criteria Queries Without Join LinesID: Q109959
|
Moderate: Requires basic macro, coding, and interoperability skills.
Join lines between tables are used to clarify relationships among data in
the joined tables and to sort and order the data. However, there are some
situations where it is not necessary to have join lines between tables.
This article demonstrates a situation where it is not necessary to have a
join line between tables.
NOTE: In Microsoft Access version 7.0, change all date references in the
example from 1995 to 1993, and in Microsoft Access versions 2.0 and 1.x,
change all date references from 1995 to 1991 to get correct results.
The sample database Northwind.mdb (or NWIND.MDB in versions 1.x and 2.0)
contains a table called Orders that has a column called Order Date. To see
all the orders placed from January 1, 1995 to February 1, 1995, you would
have to use a query because there are no join properties for unequal
(greater than or less than) comparisons.
One way to see the orders from July 1, 1995 to August 1, 1995, is to create
a table that holds the beginning and ending dates of the period you want to
see, and then to create a query comparing the fields in that table against
the Order Date column in the Orders table. The following example
demonstrates how to do this:
Table: Date Range
-----------------------
Field Name: Start Date
Data Type: Date/Time
Field Name: End Date
Data Type: Date/Time
Start Date: 01-Jul-95
End Date: 01-Aug-95
>=[Date Range].[Start Date] And <=[Date Range].[End Date]
For more information about passing values from a form to a parameter query,
search the Help Index for "Query By Form," or ask the Microsoft Access 97
Office Assistant.
For more information about parameter queries, search the Help Index for
"parameter queries."
Additional query words: queries
Keywords : QryJoin
Version : 1.0 1.1 2.0 7.0 97
Platform : WINDOWS
Issue type : kbhowto
Last Reviewed: April 2, 1999