简体   繁体   中英

Display blank(null/empty) values in ms access

I have a database in MS Access, and I ran into a problem with empty values. I have 3 tables that are connected to eachother. Lets say Table1 contains people, Table 2 contains Phone numbers, and Table 3 connects table 1 and 2, having both their ID's so I could later see what person has what numbers by using the IDs.

What I want from access is that it would display a person even if he/she doesn't have a number assigned, and also a number when there are no people assigned to it.

Something like this:

Persons_name |Phone_number
--------------------------
Fred         |    123
             |    222
Anna         |

The tables look something like this:

People                People_phones         Phones
-------------         --------------        ------------
ID                    ID                    ID
Persons_name          People_ID             Phone_number
                      Phones_ID

So far I've managed to get access to show either table 1's null values or table 2's null values, but not both.

As E Mett indicated above, your looking for a full outer join which doesn't handle directly. Here is an example of what he's suggesting:

How do I write a full outer join query in access

JB

In sql jargon what you are looking for is an outer join .

This is unfortunately not available in Ms Access because it is rarely needed.

You should create two queries, one using a left join and the other with a right join .

Then use the UNION keyword to combine the results

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM