P
Pat Dools
Hello,
I have a baseball statistics database. I want to be able to run a query w/ a
prompt that will allow the user to look at the last 'X' games, with 'X'
being supplied by the user in form of a parameter prompt. Here is the code I
am trying to use, but I continue to get syntax errors:
PARAMETERS XGames Value;
SELECT tGameStats.gamenum, tGameStats.gamedate, tOpponentTeam.teamname,
tGameStats.atbats, tGameStats.hits, tGameStats!hits/tGameStats!atbats AS BA,
tGameStats.runs, tGameStats.doubles, tGameStats.triples, tGameStats.homeruns,
tGameStats.rbi, tGameStats.walks, tGameStats.strikeouts, tGameStats.LOB,
tGameStats.sb, tGameStats.errors
FROM tGameStats LEFT JOIN tOpponentTeam ON tGameStats.teamopponent =
tOpponentTeam.teamnumber
WHERE (((tGameStats.gamenum)=SELECT(Max([gamenum])-[XGames]));
It keeps telling me I have syntax errors. How can I clean this up?
I have a baseball statistics database. I want to be able to run a query w/ a
prompt that will allow the user to look at the last 'X' games, with 'X'
being supplied by the user in form of a parameter prompt. Here is the code I
am trying to use, but I continue to get syntax errors:
PARAMETERS XGames Value;
SELECT tGameStats.gamenum, tGameStats.gamedate, tOpponentTeam.teamname,
tGameStats.atbats, tGameStats.hits, tGameStats!hits/tGameStats!atbats AS BA,
tGameStats.runs, tGameStats.doubles, tGameStats.triples, tGameStats.homeruns,
tGameStats.rbi, tGameStats.walks, tGameStats.strikeouts, tGameStats.LOB,
tGameStats.sb, tGameStats.errors
FROM tGameStats LEFT JOIN tOpponentTeam ON tGameStats.teamopponent =
tOpponentTeam.teamnumber
WHERE (((tGameStats.gamenum)=SELECT(Max([gamenum])-[XGames]));
It keeps telling me I have syntax errors. How can I clean this up?