| Database Toolbox | ![]() |
After selecting the Fields for a query, from Advanced query options select Where to retrieve only information that meets criteria you specify.
The Where Clauses dialog box appears.
Where Clauses Dialog Box
Examples Using Where Clauses
See help for each element of the dialog box for an example specific to that element.
Example Creating Queries for Results from Multiple Tables
Use Where to create queries whose results include values from multiple tables. For this example, the results include the product description and the sales volumes for each. The table salesVolume has the sales volumes and a stock number field, but not a product description field. Another table, productTable, has the product description and the stock number, but not the sales volumes. Therefore, the query needs to retrieve data from both tables and equate the stock number from productTable with the stock number from the salesVolume table.
productTable and salesVolume from Tables. In Fields, select the productTable.productDescription and the salesVolume fields, which are the fields in the query results.
productTable.stockNumber with the salesVolume.StockNumber so that the product description can be associated with sales volumes in the results.
productTable to the stock number in the salesVolume table:
productTable.stockNumber from Fields.
=.
salesVolume.StockNumber.
The Where Clauses dialog box closes. The SQL statement in the Visual Query Builder dialog box reflects the where clause.
See Also
| All or Distinct | Fields | ![]() |
© 1994-2005 The MathWorks, Inc.