logo


58.1.6 Query Tutorial: Cross Relational Query


Sometimes we want to find a selection of records for a Table based on the values of records in another Table. This is called a Cross Relational Query. For instance:

CROSS RELATIONAL QUERY

No Found

QUERY [Location] AND [HospitalRecord]Demog_Last_Name #’Jones’

8932

Notice that the Master Table and the Field Table are not the same. We can do this because the [Location] table has a relationship with the [HospitalRecord] table and the [Hospital Record] table is to the left of the [Location] table in the Relations diagram “Query Tutorial: Relationships between Tables” on page 455.

Now if we try the reverse of this:

CROSS RELATIONAL QUERY

No Found

QUERY [HospitalRecord] AND [Location]Demog_Last_Name #’Jones’

6487

At first it may seem that we have a wrong result. But we are now returning [HospitalRecord] Table records. Because there can be many [Location] records for each [HospitalRecord] record, we get a much smaller result.



Harrowex Pty Ltd
http://www.hxmedical.com
Voice:+ 61 4 27 344 279
Fax: +61 3 52 439 019
static@hxmedical.com