Download Crystal Reports User's Guide

Transcript
25 Understanding Databases
Enforced From
When you select this option, if the to table for the link is used, the link is enforced.
For example, if you create a link from TableA to TableB using Enforce From and
select only a field from TableB, the Select statement will still include the join to
TableA because it is enforced. Conversely, selecting only from TableA with the
same join condition will not cause the join to TableB to be enforced.
Note: For an explanation of from and to tables, see “Link from and link to” on
page 409.
Enforced To
When you select this option, if the from table for the link is used, the link is
enforced. For example, if you create a link from TableA to TableB using Enforce To
and select only a field from TableA, the join to TableB will be enforced, and the
Select statement that is generated will include both tables.
Note: For an explanation of from and to tables, see “Link from and link to” on
page 409.
Enforced Both
When you select this option, if either the from table or the to table for this link is
used, the link is enforced.
Equal [=] link
The result set from an Equal link includes all the records where the linked field
value in both tables is an exact match. In the following example, the Customer table
is linked to the Orders table by the Customer ID field. When the program finds a
Customer ID in the Orders table that matches a Customer ID in the Customer table,
it displays information for the corresponding records in both tables.
SQL uses the following syntax to describe an Equal link:
SELECT Customer.‘Customer ID‘,
Customer.‘Customer Name‘,
Orders.‘Order Amount‘
FROM ‘Customer‘ Customer,
‘Orders‘ Orders
WHERE Customer.Customer ID =
Orders.Customer ID
Crystal Reports User’s Guide
423