Hi All,
I'm trying to run a top 10 query where I ignore the names of 5 people but include the rest. The sql I've got so far is:
SELECT TOP 10 Sum([All Combined].SumOfTotalCost) AS SumOfSumOfTotalCost, [All Combined].name
FROM [All Combined]
WHERE (((Month([Month]))=Month(Now())-1)) and ((([All Combined].name) Not In (([All Combined].name)="PERSON1", ([All Combined].name)="PERSON2", ([All Combined].name)="PERSON3", ([All Combined].name)="PERSON4", ([All Combined].name)="PERSON5")))
GROUP BY [All Combined].name
ORDER BY Sum([All Combined].SumOfTotalCost) DESC;
However, this only takes off person 1, the other 4 are still appearing in the top 10. Without the "Not" part, the query works fine.
What have I done wrong?
I'm trying to run a top 10 query where I ignore the names of 5 people but include the rest. The sql I've got so far is:
SELECT TOP 10 Sum([All Combined].SumOfTotalCost) AS SumOfSumOfTotalCost, [All Combined].name
FROM [All Combined]
WHERE (((Month([Month]))=Month(Now())-1)) and ((([All Combined].name) Not In (([All Combined].name)="PERSON1", ([All Combined].name)="PERSON2", ([All Combined].name)="PERSON3", ([All Combined].name)="PERSON4", ([All Combined].name)="PERSON5")))
GROUP BY [All Combined].name
ORDER BY Sum([All Combined].SumOfTotalCost) DESC;
However, this only takes off person 1, the other 4 are still appearing in the top 10. Without the "Not" part, the query works fine.
What have I done wrong?