0

Hello all, working in VB6 I want to pull all records from Access table named Answers that in a field named Color have "White". Within that record there are 10 fields of various numbers that I want to sum and average. In short I want to pull all records with White as the color and average the sums of each of the additional fields in the pulled records.

Using the code below I'm getting a "Syntax Error Missing an Operator" error. What am I missing? Sorry for the befuddled explanation and thanks for the help.

strColor = "White"
strSQL = "Select Answers.Color,Sum(Answer2)/7 as TotAns2 FROM Answers GROUP BY Answers.Color WHERE Answers.Color = '" & strColor & "'"

2
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by EddyLLC
0
strSQL = "Select Answers.Color,Sum(Answer2)/7 as TotAns2 FROM Answers
  WHERE Answers.Color = '" & strColor & "'  GROUP BY Answers.Color"
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.