View Full Version : Easy Question (I think)


Little_Man22
10-15-2001, 06:16 PM
I'm trying to run a query between three tables.

Basically what needs to happen is the following:
-policy ID (in the clientdata and currentID tables) needs to link these two tables together so that the client data shows for the current policy .. easy enough - I got this part to work
-agent1 and agent2 (from the clientdata table) need to link with the fullagentinfo table so that when an agent is entered in these fields and the query is run it brings up the agents full info.

i.e. For policy #123 John and Joe are the agents. This data is stored in the clientdata table. When we run the query I want all of John and Joes information, along with the policy id, to come up (full name, birthdate, etc) which is all stored in the fullagentinfo table. So I want the query output to look like:

123 John Smith 10/10/29
123 Joe Smith 09/09/60

Thanks in advance

Pat Hartman
10-16-2001, 04:02 PM
1. Open the query in QBE view.
2. Add the FullAgentInfo table twice. The second time that you add it, Access will suffix the table name with "_1".
3. Draw a join line from the agent1 field to the FullAgentInfo table
4. Draw a join line from the agent2 field to the FullAgentInfo_1 table.
5. Change both joins to LEFT in case both do not have agentId filled in.
6. Select the columns you need from each table.
7. Rename the columns that hold the agent information so that it is easy to tell which agent they refer to. ie. A1FullName, A2BirthDate, A2FullName, A2BirthDate etc.