I have a complicated SQL query below which works fine until i want to select just one persons record from a group using the WHERE PlayerID part.
SELECT Sum(Seasons.Appearances) AS SumOfAppearances, Players.Player, Sum(Seasons.League_Goals) AS SumOfLeague_Goals, Sum(Seasons.Cup_Goals) AS SumOfCup_Goals, [SumOfLeague_Goals]+[SumOfCup_Goals] AS Expr1, Players.PlayerID
FROM Players INNER JOIN Seasons ON Players.PlayerID = Seasons.PlayerID
GROUP BY Players.Player, Players.PlayerID, Seasons.PlayerID
WHERE PlayerID = 'MMColParam'
Whenever i try to select an individual record i get this error message.
[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'Players.PlayerID WHERE PlayerID = '5''.
Can anyone help?
SELECT Sum(Seasons.Appearances) AS SumOfAppearances, Players.Player, Sum(Seasons.League_Goals) AS SumOfLeague_Goals, Sum(Seasons.Cup_Goals) AS SumOfCup_Goals, [SumOfLeague_Goals]+[SumOfCup_Goals] AS Expr1, Players.PlayerID
FROM Players INNER JOIN Seasons ON Players.PlayerID = Seasons.PlayerID
GROUP BY Players.Player, Players.PlayerID, Seasons.PlayerID
WHERE PlayerID = 'MMColParam'
Whenever i try to select an individual record i get this error message.
[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'Players.PlayerID WHERE PlayerID = '5''.
Can anyone help?