I have a database with two related tables that I'm working to query. The tables are "Alumni" and "SeminarStaffers".
The "Alumni" table has a multiselect listbox that allows input of multiple staffers from the "SeminarStaffers" table.
The "SeminarStaffers" table looks like this:
The "Alumni" table looks a little like this:
I would like to write a query that only results in the following:
This SQL code that I tried is not working. I think it's because "Staffers2" is a multiple lookup field (with multiselect listbox). Here's the code I tried:
Instead of what I want, the above SQL results in:
I appreciate any help you can provide.
The "Alumni" table has a multiselect listbox that allows input of multiple staffers from the "SeminarStaffers" table.
The "SeminarStaffers" table looks like this:
Code:
ID StafferName
1 Carl
2 Natalia
3 Daniel
4 Bob
5 Richard
The "Alumni" table looks a little like this:
Code:
ID Last SeminarName Staffers2
1 Johnson Teachers1 Carl, Natalia
2 Paulson Teachers1 Carl, Natalia
3 Robinson Teachers1 Carl, Natalia
4 Wolf Media1 Daniel, Natalia
5 Scott Media1 Natalia, Daniel
6 Roberts Teachers2 Natalia
7 Street Teachers2 Natalia
8 Duzan Sports1 Bob
9 Williams Sports1 Bob
10 Lord Media2 Richard, Carl
11 Elder Media2 Richard, Carl
I would like to write a query that only results in the following:
Code:
Alumni.Last Alumni.SeminarName Alumni.Staffers2
Roberts Teachers2 Natalia
Street Teachers2 Natalia
This SQL code that I tried is not working. I think it's because "Staffers2" is a multiple lookup field (with multiselect listbox). Here's the code I tried:
Code:
SELECT Alumni.Last, Alumni.SeminarName, Alumni.Staffers2
FROM SeminarStaffers INNER JOIN Alumni ON SeminarStaffers.ID = Alumni.Staffers2.Value
WHERE (((SeminarStaffers.StafferName)="Natalia"));
Instead of what I want, the above SQL results in:
Code:
Alumni.Last Alumni.SeminarName Alumni.Staffers2
Johnson Teachers1 Carl, Natalia
Paulson Teachers1 Carl, Natalia
Robinson Teachers1 Carl, Natalia
Wolf Media1 Daniel, Natalia
Scott Media1 Natalia, Daniel
Roberts Teachers2 Natalia
Street Teachers2 Natalia
I appreciate any help you can provide.