Free Lessons
Fast Tips
Topic Index
Home   Courses   Seminars   Templates   TechHelp   Fast Tips   Forums   Help   Contact   Join   Order   Logon  
Home > Forums > Access
Access Forum

Back to Access Forum

Ranking in Access with Points Upload Images   Link  
Darrin Hebert 
7 days ago
I have a potentially uncommon problem I'm trying to solve.

Imagine playing golf with a group of people with recurring tournaments.  There is a scoring system that awards points based on how your score compares to others.
I.E. 1st place awards 100 pts, 2nd 95, 3rd 90, and so on.

I have solved for ranking the scores.  my challenge is on how to handle some limitations with players getting the same score and therefore getting the same rank.  (I can deal with this as is) however, for the players that get the same score, I want to calculate how points are distributed amongst them.  

Rules for distribution of points when ties occur:
sum points for ranks 1,2,3... in this case 100+95+90=285, then evenly assign to each tying golfer... in this case that would give golfers 1,2,3 95 points each (285/3)... note that it is also possible for there to be other tying scores down the list (golfers 15 & 30 have a score of 40)

Ranks & Points:

Example golfer, tourn scores, ranks & points:
golfer 1, score 30, rank 1, points 100
golfer 2, score 30, rank 1, points 100
golfer 3, score 30, rank 1, points 100
golfer 4, score 31, rank 4, points 85

My SQL at this point: (which gives me a "#Error" in datasheet view (Adjustment field). I haven't gotten to the division part yet. Position=Rank

SELECT [MajorScoreOrderingQ P2].[WGT Name], [MajorScoreOrderingQ P2].Position, (DSum("[MajorPosPts]","[MajorPtSystem]","[MajorsPosition]=[" & [Position])) AS Adjustment
FROM MajorPtSystem INNER JOIN [MajorScoreOrderingQ P2] ON MajorPtSystem.MajorsPosition = [MajorScoreOrderingQ P2].Position
GROUP BY [MajorScoreOrderingQ P2].[WGT Name], [MajorScoreOrderingQ P2].Position
ORDER BY [MajorScoreOrderingQ P2].Position;

any assistance is greatly appreciated and hopefully this doesn't constitute writing a book.
Scott Axton
5 days ago
The #Error usually is an indication that there isn't information in a field to be able to perform a calculation.

See the Calculated Fields and the NZ Function videos.
Darrin Hebert
5 days ago
Hi Scott, thanks for the tip, however I believe my issue is different than assuming a zero (or some other value).  While it may be true that the #Error suggests there isn't information in the Adjustment field, I'm trying to figure out why that may be.  Because the underlying queries all return the results I'm looking for.   I believe my issue may be in the use or the way I'm using DSum.

Is there anything I can share i.e. query results, table values, etc. that might aid in this troubleshooting?
Alex Hedley
5 days ago
Is this a typo: [MajorsPosition]=[
Darrin Hebert
5 days ago

Darrin Hebert
5 days ago

Darrin Hebert
5 days ago

Darrin Hebert
5 days ago

Darrin Hebert
5 days ago

Darrin Hebert
5 days ago

Darrin Hebert
5 days ago

Darrin Hebert
5 days ago

Darrin Hebert
5 days ago

Darrin Hebert
5 days ago
Hi Alex, No [MajorsPosition]=[ is not a typo, it is the criteria for my DSum... specifically, I'm trying to add the points for the golfers that have the same 'Rank'.
Kevin Robertson
5 days ago
Alex is right. You have an extra bracket that isn't needed.
In MajorScoreOrderingQ P3:

Adjustment: DSum("MajorPosPts","MajorPtSystem","MajorsPosition=" & [Position])
Alex Hedley
5 days ago
Prob not a good idea having spaces in your Query names too
Darrin Hebert
5 days ago
Thanks All, appreciate your help.   I mis-understood the question regarding the typo, indeed you were correct about the extra bracket.  thanks again.
Alex Hedley
4 days ago
Sorry for being vague, I like to get you thinking :p
Add a ReplyUpload an Image

Back to Access Forum Comments

Start a NEW Conversation
Only students may post on this page. Click here for more information on how you can set up an account. If you are a student, please Log On first. Non-students may only post in the Visitor Forum.
Subscribe to Access Forum
Get notifications when this page is updated

Check out these other pages that may be of interest to you:

11/29/2022Date Buttons
11/29/2022Change Date Field
11/28/2022Top X
11/27/2022System Settings
11/25/2022Application Title
11/24/2022Full HTML Editor in Access
11/24/2022Change Database Title
11/23/2022Other Names
11/21/2022Check Icon File
11/21/2022Check Icon File

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.

Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
My Account
My Courses
Lost Password
Student Databases
Change Email
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Customer Support
Web Site Tour
Consulting Services
Affiliate Program
Richard Rost
Free Lessons
Mailing List
Video Tutorials
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Terms of Sale
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
Blog RSS Feed    Twitter

YouTube Channel    LinkedIn