Help with query

dgmorr

Registered User.
Local time
Yesterday, 22:26
Joined
Jan 10, 2007
Messages
71
Hey guys,

I have a table with 50 records and another table with 10 records. The table qith 10 records correspond to 10 of the records in the larger table. How do I make a query to show all 50 records, but include the extra fields from the 10 records where applicable? They way my query runs only shows 10 records.

Code:
Table1           
ID     Name     
1      John
2      Julie
.
.
50     Jane

Table2
ID    Car
1     Honda
50    Toyota

Query to Show

1     John    Honda
2     Julie
50    Jane    Toyota
 
Last edited:
Look up "OUTER JOIN" in Access Help. You can design an SQL query that would do exactly as you described.

Be prepared to use the NZ function on the fields that might be null due to having no corresponding records from the side of the join operation that has fewer records.
 
Look up "OUTER JOIN" in Access Help. You can design an SQL query that would do exactly as you described.

Be prepared to use the NZ function on the fields that might be null due to having no corresponding records from the side of the join operation that has fewer records.

Heh, yeah, I just used a right join and it works now. Thanks!
 

Users who are viewing this thread

Back
Top Bottom