I have tried a number of different ways to set this query up, but i can't seem to get it to work.
I am working on a sports referee assignment database. This database has three different elements I am working with: games, leagues and referees. Each referee may belong to one or more leagues. Each game is assigned to one league. My tables are set up as follows:
Table Games
GameID (primary key)
LeagueID (lookup to the League table)
Table Leagues
LeagueID (primary key)
NameOfLeague (text description)
Table Referees
RefereeID (primary key)
RefereeName (name of referee)
Table RefereeLeague (foreign key table)
RefRLID (lookup to primary key in Referee table)
LeagueRLID (lookup to primary key in League table)
The RefereeLeague table is a foreign key table that lists all of the ALLOWED referee-league combinations.
I am trying to generate a query that will generate a list of all games, and each referee that is NOT allowed to work the game. For example:
LEAGUES: (each has a primary key defined)
League A
League B
League C
GAMES:
G#1, League A
G#2, League B
G#3, League C
REFEREES: (each has a primary key defined)
Ref1
Ref2
Ref3
Ref4
REFEREELEAGUE Table (list of allowed referee-league combinations)
Ref1, League A
Ref2, League B
Ref3, League A
Ref3, League B
will generate the following list of conflicts:
G#1, Ref2
G#1, Ref4
G#2, Ref2
G#2, Ref3
G#2, Ref4
G#3, Ref1
G#3, Ref2
G#3, Ref3
G#3, Ref4
any thoughts? this one really has me stumped. thanks in advance
-jeff wigal
jeff@wigaldesign.com
I am working on a sports referee assignment database. This database has three different elements I am working with: games, leagues and referees. Each referee may belong to one or more leagues. Each game is assigned to one league. My tables are set up as follows:
Table Games
GameID (primary key)
LeagueID (lookup to the League table)
Table Leagues
LeagueID (primary key)
NameOfLeague (text description)
Table Referees
RefereeID (primary key)
RefereeName (name of referee)
Table RefereeLeague (foreign key table)
RefRLID (lookup to primary key in Referee table)
LeagueRLID (lookup to primary key in League table)
The RefereeLeague table is a foreign key table that lists all of the ALLOWED referee-league combinations.
I am trying to generate a query that will generate a list of all games, and each referee that is NOT allowed to work the game. For example:
LEAGUES: (each has a primary key defined)
League A
League B
League C
GAMES:
G#1, League A
G#2, League B
G#3, League C
REFEREES: (each has a primary key defined)
Ref1
Ref2
Ref3
Ref4
REFEREELEAGUE Table (list of allowed referee-league combinations)
Ref1, League A
Ref2, League B
Ref3, League A
Ref3, League B
will generate the following list of conflicts:
G#1, Ref2
G#1, Ref4
G#2, Ref2
G#2, Ref3
G#2, Ref4
G#3, Ref1
G#3, Ref2
G#3, Ref3
G#3, Ref4
any thoughts? this one really has me stumped. thanks in advance
-jeff wigal
jeff@wigaldesign.com