Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
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 
3 months ago
I have a potentially uncommon problem I'm trying to solve.

Overview:
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.

Problem:
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:
1-100
2-95
3-90
4-85

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
3 months 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
3 months 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
3 months ago
Is this a typo: [MajorsPosition]=[
Darrin Hebert
3 months ago

Darrin Hebert
3 months ago

Darrin Hebert
3 months ago

Darrin Hebert
3 months ago

Darrin Hebert
3 months ago

Darrin Hebert
3 months ago

Darrin Hebert
3 months ago

Darrin Hebert
3 months ago

Darrin Hebert
3 months ago

Darrin Hebert
3 months 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
3 months ago
Alex is right. You have an extra bracket that isn't needed.
In MajorScoreOrderingQ P3:

Adjustment: DSum("MajorPosPts","MajorPtSystem","MajorsPosition=" & [Position])
Alex Hedley
3 months ago
Prob not a good idea having spaces in your Query names too
Darrin Hebert
3 months 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
3 months ago
Sorry for being vague, I like to get you thinking :p

This thread is now closed. If you wish to comment, start a NEW discussion, below.
 


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
Subscribe to Access Forum
Get notifications when this page is updated
 
 

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

2/2/2023Import Objects
2/1/2023Continuous Forms Not Working
1/31/2023Group On Top
1/30/2023Association 8
1/27/2023Math in Fields
1/26/2023Association 7
1/25/2023Change Query
1/24/2023Association 6
1/23/2023Association 5
1/20/2023Association 4
 
 

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

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    Twitter

YouTube Channel    LinkedIn
Copyright 2023 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 2/2/2023 11:36:56 PM.