Query 3 tables

SamMaynard

Board Regular
Joined
Dec 4, 2002
Messages
106
Database info...
I have one table called tblStudents with a unique identifyer feild called StudentID.

Another table called tblRoomsNumbers with a unique identifyer feild called RoomNumber.

Then I have a third table called tblRoomMates that has two feilds named StudentID and RoomNumber (both are a lookup data type). The idea is to join have the RoomNumber feild joined to one or more StudentID. This works well. No problems

Here is the problem...
When I query using the tblStudents and tblRoomMates tables and a student hasn't been assigned to a room yet in the tblRoomMates table, that student will not come up in the query at all. In other words I am querying lots of info from the table tblStudents like phone numbers, age ect. but if they haven't been assigned a room number from the table tblRoomMates none of their data comes up.

Question...Any ideas how to get the students info like phone number, age, ect. to come up even when the student hasn't been assigned a room number?

Also...
Any idea how to generate a query that will list the students who haven't been assigned a room?
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
1.
in your query, double click on the join line between the two StudentID fields, this should bring up the "Join Properties" for your query. Then select the option to "Include All Records from 'tblStudents'...
Thus, all students, even those who aren't in your Roommates table, should show in your query.

2.
To show only those students w/out a room... do what I suggested above, only just put "Is Null" as a criterion for [studentID] in your roommates table

I hope that was clear..
 
Upvote 0

Forum statistics

Threads
1,221,572
Messages
6,160,575
Members
451,656
Latest member
SBulinski1975

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top