Print a selected sum

  • Thread starter Thread starter carter
  • Start date Start date
C

carter

Each player earns points for victories (ptsearned). I would like to print on
a report only those players who have earned 5 or more points? Using Access
2007.

Carter
 
Try this --
SELECT Player, Sum([ptsearned]) AS Points
FROM tblPoints
GROUP BY Player
HAVING Sum([ptsearned]) >=5;
 
Right, not much to go on...I have produced the report and it groups on
playerName and YearWon. It also has the DivisionWon. A point is awarded in
ptsearned for each divisionwon. I also added a total control to sum each
players points. Currently I can print all the players and their points and I
can print an individual player and their points. Having trouble with printing
only players with 5 or more points. Thanks.


KenSheridan via AccessMonster.com said:
You haven't given us much to go on, but you'll probably need a query as the
report's RecordSource which sums the ptsearned values per player and includes
a criterion of the summed points being >=5 in its HAVING clause, e.g.

SELECT [player], SUM([ptsearned]) As TotalPoints
FROM [YourTable]
GROUP BY [player]
HAVING SUM([ptsearned]) >=5;

If you want to include other fields on which the query can't be grouped, e.g.
the individual points earned by the player per game then it’s a little more
complex.

If you need more help post back with details of the table(s) and fields
involved.

Ken Sheridan
Stafford, England
Each player earns points for victories (ptsearned). I would like to print on
a report only those players who have earned 5 or more points? Using Access
2007.

Carter

--
Message posted via AccessMonster.com


.
 
Back
Top