Using Tables and Views in WHERE Clauses

You can join to other database tables and views and constrain the displayed data based on values in those tables.

Joining two tables via the Add WHERE Clause dialog.

You can also “hop” from one level (table) to the next record connected by the original record.  For example, if you have an Order record containing a Customer ID, you can display the Customer’s Last Name by selecting the Foreign Key relationship of “Orders to Customers”.  This is only applicable from a parent to a child, not from a child to a parent.

You can display data from fields in several tables that are joined via their foreign key relationships.

In this example, the page displays fields from both the Orders and Customers tables by using the foreign key relationship between Orders.Customer and the Customers table.

Foreign key relationships can be:

See Also

Customizing Database Queries with the Query Wizard

Using Tables and Views in WHERE Clauses

Using Constant Values in WHERE Clauses

Using URL Parameters in WHERE Clauses

Using the Logged-In User ID in WHERE Clauses

Calling Custom Code Functions in WHERE Clauses

Adding a Custom Query