user1211970
user1211970

Reputation: 11

Access 2010 query still showing results when record empty

I am trying to make a query joining 4 tables. One table will only fill out some records, not all. How do I get the criteria to be:

If record is null still show the field..... because right now if the record is null in any one of the fields it will not show in my query results.

Upvotes: 1

Views: 1128

Answers (3)

Olivier Jacot-Descombes
Olivier Jacot-Descombes

Reputation: 112772

If records are missing in one table, then you must use an outer join. Say, you have a table A with 5 records and a table B with only 3 records and you want to make a query joining the two tables showing 5 records

SELECT * FROM
    A
    LEFT JOIN B
        ON A.ID = B.FK

In the query designer, right click on the join-line and enter this:

enter image description here

Upvotes: 2

dev_etter
dev_etter

Reputation: 1186

It sounds like you need to use a LEFT (or "outer") Join instead of an INNER join.

Outer joins (like LEFT JOINs) will return all results whether there are matching records in the other table or not. You'll just have null column values in the results for the joined tables.

More info here: http://pcmcourseware.com/blog/2010/11/10/modifying-query-joins-in-microsoft-access/

Upvotes: 0

VeeArr
VeeArr

Reputation: 6188

It sounds like you want your filter conditions to ignore NULLs. (That is, by default a NULL wouldn't match your filter, but the desired output is that it should.)

If this is correct, you want to modify the filters to allow NULLs, for example by adding OR IS NULL.

Upvotes: 0

Related Questions