Select Query: Missing results due to two tables

JimmyG

Registered User.
Local time
Today, 05:36
Joined
Aug 3, 2004
Messages
37
Hi

I need to use my database for a mail merge to create labels. The problem is that my contact details are entered into two seperate tables through a form and a subform. My Customers form has a contacts subform to allow me to enter contact details for more than one employee per customer.

I have created a select query, with various parameters, to return all the address's of the customers. Unfortunately I don't have employee details for all my customers so I need the query to return all of the customers and their contacts if they are entered but also all those other customers who don't have contacts entered.

Only those with contacts are returned when I run the query. The only way I can get the query to return all my customers is to remove the contacts table from the query but this will therefore mean the contact names I have won't appear on the address labels.

Is there any way to solve this problem so I get a list of all the customers, including those with employees entered but also those without employees included to?

Thanks
 
Use a left join in the query (if you have yet to learn sql statements) its the black line connecting the two tables, double click and change it so it says everything from the first table and only those that match from the second.


Vince
 
Excellent!!! :D

Thanks for your help.
 

Users who are viewing this thread

Back
Top Bottom