Ronage
August 4th, 2003, 02:49 PM
Situation:
Access Database
Goal: Construct a SQL statement to join data from two tables.
Table1 is a schedule
Fields are like this:
Date | Time | Team1 | Team2 |Location etc.
Table2 has the Team Names:
Team_ID | TeamName
I am trying to write a SQL statement that will give me the complete schedule for all teams which includes the Team Name and team number for each of team1 and team2.
Right now the SQL looks like this but Access complains:
SELECT S.GameDate, S.GameTime, H.TeamName, V.TeamName
FROM SchGames S
LEFT JOIN Team H ON (H.TeamNumber = S.HomeTeamNumber)
LEFT JOIN Team V ON (V.TeamNumber = S.VisitingTeamNumber);
A sample file is attached if you want to look at it and here are two screenshots of the tables..
http://injectionmolds.com/misc/table_SchGames.gif
http://injectionmolds.com/misc/table_team.gif
TIA
Access Database
Goal: Construct a SQL statement to join data from two tables.
Table1 is a schedule
Fields are like this:
Date | Time | Team1 | Team2 |Location etc.
Table2 has the Team Names:
Team_ID | TeamName
I am trying to write a SQL statement that will give me the complete schedule for all teams which includes the Team Name and team number for each of team1 and team2.
Right now the SQL looks like this but Access complains:
SELECT S.GameDate, S.GameTime, H.TeamName, V.TeamName
FROM SchGames S
LEFT JOIN Team H ON (H.TeamNumber = S.HomeTeamNumber)
LEFT JOIN Team V ON (V.TeamNumber = S.VisitingTeamNumber);
A sample file is attached if you want to look at it and here are two screenshots of the tables..
http://injectionmolds.com/misc/table_SchGames.gif
http://injectionmolds.com/misc/table_team.gif
TIA