Struggling with query of 2 tables

Caliban1971

New member
Local time
Today, 18:19
Joined
May 10, 2011
Messages
4
Hi.

This may be an easy one, but I can't seem to figure it out. I have a query that pulls data from 2 tables based on criteria selected from combo boxes in a pop-up form. Here is a brief discription of the tables with the most relevant field for my question:

Table 1: Employment History: Field=Job Title
Table 2: Customer Engagement: Field= Engagement Type (phone, email,etc)

The idea is that we get customers from a variety of occupations (table 1) and then engage them, either with email, phone, or in person (table 2). The main customer demographic info (name, address, etc.) is in a separate customer table.

If I query for an occupation and there is a related field in Engagement, it will show them. But if there has been no engagement, if I have an occupation but didn't do any entry for them in table 2, it will return no values. For example:

Table 1 has 3 RN's, and each has a related engagement in Table 2. So the query will show those RN's.

Table 1 has 3 LPN's, but they don't have any related engagement in Table 2. The query returns no values. It looks as if I have no LPN's.

The purpose of my query is to easily filter through all the occupations, and get the relative info about their engagement, whether or not there is any engagement.

Is this possible? Sorry it is so long. Any help is appreciated.

Michael
 
Last edited:
Sounds like in the query you need to change the Join Type from INNER to LEFT (maybe RIGHT) as I'm unsure of the structure. However, INNER will not work as the Entity has to be in both tables in order to show in that type of query.
 
What Gina says sounds about right... if you go to the query design and double-click the line connecting the two tables there will be three options at the bottom, to return all records from employment history, to return all records from engagement or to only return records where both match.

I'm not sure I'm getting how your table structure works though, are both of the tables you are using on the many side of a one-to-many relationship with your customer table?
 

Users who are viewing this thread

Back
Top Bottom