Query or queries

  • Thread starter Thread starter Dan
  • Start date Start date
D

Dan

I have a query based on two tables. One table has ID
number, point, and a Code field with either an X or a C.
the other table has ID, Name etc. I have created a query
that sums the points. I also want to see the amount of
points for the X's and the C's.

I am not sure how to do this in a single query. I can
break them out with a count but not sure where to go from
there.

If I create 3 queries and query the queries it does
a "trickle down" 15 ID's and only report 7. Not sure how
to correct this.

Which is the better way and what am I missing to make this
work??
 
Try this:

SELECT [ID Number], Sum([Point]) AS SumOfPoints,
Count(Abs([Point]="X")) AS CountOfXPoints,
Count(Abs([Point]="C")) AS CountOfCPoints
FROM FirstListedTableInYourPost
GROUP BY [ID Number];
 
Back
Top