B
BrianB via AccessMonster.com
I have the following (sub)query (generated using the wizard), this is the
copied SQL code
SELECT Client.ID, Client.LastName, Client.FirstName, Client.Saltn, Client.
RegisterDate, Client.LastUpdate, Contact.ClientID, Contact.Category, Contact.
Primary, [contact]![type] & ": " & [contact]![contactdetail] AS Phone
FROM Client LEFT JOIN Contact ON Client.ID = Contact.ClientID
WHERE (((Contact.Category)="phone") AND ((Contact.Primary)=True));
This joins 2 tables, the client and their phone/email contacts (phone no.
email address) It allows for many categories (ex phone, email, website,..)
and types (home, mobile, business,...) and also indicates the one they wish
as primary. I wish to pick off the primary phone and email to include in
another query (because as it turns out it has this same problem, so if can
solve it here I won't need this solution, I'll be able to do it directly)
From this query I want EVERY client and, where there are phone numbers or
emails to have them ADDED to the result (the email part has been excluded
during this testing, but the same issue exists). The above SQL only returns
clients WHERE primary phone numbers exist. I set the join type in the
wizard for "all client" and "contacts where they exist" (A LEFT(outer) join
should be the right type as was generated in the SQL??).
My client DB has 169 records and the query returns 108 which if I count the
primary phone numbers is correct. When I add the emails I only get 97
records. I have tried the other join options and they don't work either.
Help please !!
thanks
copied SQL code
SELECT Client.ID, Client.LastName, Client.FirstName, Client.Saltn, Client.
RegisterDate, Client.LastUpdate, Contact.ClientID, Contact.Category, Contact.
Primary, [contact]![type] & ": " & [contact]![contactdetail] AS Phone
FROM Client LEFT JOIN Contact ON Client.ID = Contact.ClientID
WHERE (((Contact.Category)="phone") AND ((Contact.Primary)=True));
This joins 2 tables, the client and their phone/email contacts (phone no.
email address) It allows for many categories (ex phone, email, website,..)
and types (home, mobile, business,...) and also indicates the one they wish
as primary. I wish to pick off the primary phone and email to include in
another query (because as it turns out it has this same problem, so if can
solve it here I won't need this solution, I'll be able to do it directly)
From this query I want EVERY client and, where there are phone numbers or
emails to have them ADDED to the result (the email part has been excluded
during this testing, but the same issue exists). The above SQL only returns
clients WHERE primary phone numbers exist. I set the join type in the
wizard for "all client" and "contacts where they exist" (A LEFT(outer) join
should be the right type as was generated in the SQL??).
My client DB has 169 records and the query returns 108 which if I count the
primary phone numbers is correct. When I add the emails I only get 97
records. I have tried the other join options and they don't work either.
Help please !!
thanks