I'm having a problem with the proper syntax for a query Statement and I'm getting An Error 3075 Syntax Error.
Sql2 = "SELECT WeeklyPicks.GameID, WeeklyPicks.Week, WeeklyPicks.Username, WeeklyPicks.Pick," & _
"qryCalculateScores.Winner, WeeklyPicks.TieBreakerPoints" & _
"FROM WeeklyPicks INNER JOIN qryCalculateScores ON" & _
"(WeeklyPicks.Pick = qryCalculateScores.Winner) AND (WeeklyPicks.GameID = qryCalculateScores.GameID)" & _
"WHERE (((WeeklyPicks.Week) =" & WeekNum & ") And ((WeeklyPicks.UserName) ='" & CurrentUser & "'))" & _
"ORDER BY WeeklyPicks.Username;"
WeekNum is an Integer
CurrentUser is Text
I'm not sure if there are any apostrophe's required in the join statements. I've tried to add spaces here to separate each section of the query to make it easier to read.
hascons
Sql2 = "SELECT WeeklyPicks.GameID, WeeklyPicks.Week, WeeklyPicks.Username, WeeklyPicks.Pick," & _
"qryCalculateScores.Winner, WeeklyPicks.TieBreakerPoints" & _
"FROM WeeklyPicks INNER JOIN qryCalculateScores ON" & _
"(WeeklyPicks.Pick = qryCalculateScores.Winner) AND (WeeklyPicks.GameID = qryCalculateScores.GameID)" & _
"WHERE (((WeeklyPicks.Week) =" & WeekNum & ") And ((WeeklyPicks.UserName) ='" & CurrentUser & "'))" & _
"ORDER BY WeeklyPicks.Username;"
WeekNum is an Integer
CurrentUser is Text
I'm not sure if there are any apostrophe's required in the join statements. I've tried to add spaces here to separate each section of the query to make it easier to read.
hascons