TheQuestioner
Programmer
Hi
I'm having a problem trying to create a SQL statement. I have 3 tables which are composed of:-
tblDirectors
tblDirectorOfficeReferences
tblOffices
I want to create the folloiwng results:-
I want to return whether each director has an occurance of an office with type CT, PA or VA within tblOffices. Any help would be greatly appreciated.
I'm having a problem trying to create a SQL statement. I have 3 tables which are composed of:-
tblDirectors
Code:
ID Name
----------------
1 Gorden
2 Alyx
3 Eli
tblDirectorOfficeReferences
Code:
ID IDDirector IDOffice Ref
-------------------------------
1 2 1 Test 156
2 2 2 Test 562
3 1 5 Test 099
4 3 1 Test 984
5 3 7 Test 125
6 3 5 Test 456
tblOffices
Code:
ID Name Type
---------------------
1 Alpha CT
2 Beta CT
3 Charlie CT
4 Delta PA
5 Echo PA
6 Foxtrot PA
7 Golf VA
8 Hotel VA
9 India VA
Code:
DirectorID DirectorName CTOffice PAOffice VAOffice
---------------------------------------------------
1 Gorden No Yes No
2 Alyx Yes No No
3 Eli Yes Yes Yes
I want to return whether each director has an occurance of an office with type CT, PA or VA within tblOffices. Any help would be greatly appreciated.