Include all


H

Hendrix

I am running a query using two tables...table 1 has 3million records
and table 2 has 1 million records. There are three fields that I am
using to link the two tables. I would like to include all the records
from table 1 but when I try to do so I keep getting an error msg. Is
there a way to do this?
 
Ad

Advertisements

J

John W. Vinson

I am running a query using two tables...table 1 has 3million records
and table 2 has 1 million records. There are three fields that I am
using to link the two tables. I would like to include all the records
from table 1 but when I try to do so I keep getting an error msg. Is
there a way to do this?
Probably. It would help if you would post the SQL of the query you are using
and the error message. You can see your screen - we cannot!

I'd expect something like

SELECT <whatever you want to see>
FROM Table1 LEFT JOIN Table2
ON Table1.Field1 = Table2.Field1
AND Table1.Field2 = Table2.Field2
AND Table1.Field3 = Table2.Field3


should work; this would contain all the records from Table1 (matched or not),
with all the matching records from Table2, and NULL values for the Table2
fields in those records with no match.

If you are building the query in the grid, you will need to have three Join
lines on the three fields; *each one* of them must be selected and set to
Option 2 - "Show all records in Table1 and matching records in Table2'.
--

John W. Vinson [MVP]
Microsoft's replacements for these newsgroups:
http://social.msdn.microsoft.com/Forums/en-US/accessdev/
http://social.answers.microsoft.com/Forums/en-US/addbuz/
and see also http://www.utteraccess.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top