I have an ACCESS table named Reviewer Score Averages containing information on company reviews done by individuals, structured like this:
ID | Reviewer | Company | ReviewScore
The Company field can only hold four values:
STARBUCKS
MCDONALDS
GREENMOUNTAIN
CARIBOU
We have an SQL query that averages all the ReviewScores for a given Reviewer, but want to modify it so that it also calculates an average of all ReviewScores for Companies other than CARIBOU.
The original, functional query is:
SELECT [Reviewer Score Averages].Reviewer,
Reviewers.[Last Name] & ", " & [First Name] AS Name,
Reviewers.[Email Address],
Avg([Reviewer Score Averages].[1stReviewScore]) AS AvgOfAllReviews;
The edited version, that so far does not work, is:
SELECT [Reviewer Score Averages].Reviewer,
Reviewers.[Last Name] & ", " & [First Name] AS Name,
Reviewers.[Email Address],
Avg([Reviewer Score Averages].[1stReviewScore]) AS AvgOfAllReviews,
Avg([Reviewer Score Averages].[1stReviewScore]
WHERE [Reviewer Score Averages].[Company] = 'STARBUCKS' OR 'MCDONALDS' OR 'GREENMOUNTAIN') AS AvgOfNonCaribou;
When I try to run this code, I get an error message that I am missing an operator: I've looked at Microsoft's documentation for WHERE syntax, but I don't see anything on it that I'm obviously missing.
This is a table in an Access 2003 database.
What am I doing wrong? Am I misusing WHERE? Is my syntax wrong? Am I missing something? Is there a better way to approach the problem?
Thanks very much for your help.