Juan,

Good question. ref_pts are given for completing referee assignments and are tracked throughout the season and can exceed 15 for tracking purposes. However, only a max of 15 total_ref_pts are used in determining the standings. adust_ref_pts (up or down) are given by the Referee Assignor for situations not covered in the normal automatic system. Again, they want to track this total throughout the season, but only use a max of 15 total_ref_pts for computing the standings.

In your example, they want to know the true values of 10, 9 and 7, but total_pts would only add up to 25 for computing the standings (10 game_pts and 15 total_ref_pts). Make sense?

Albert

On Oct 22, 2004, at 11:46 AM, Juan M. Quiroz wrote:

I have some questions.
Is the information on those fields used as their true value? Meaning are
you always have to manipulate the data, then why not enter the correct
information instead of manipulating. If this is a special case I can see is
necessary.
so if the values for game_pts, ref_pts, adjust_ref_pts are 10, 9, 7 can it
take its true add of 26 or should it be 25? Then why not have the right
values to begin with.
Just curious.


Juan

"Albert Padley on 10/21/04 at 9:48 PM -0600 wrote about: Sort Problem"
I've inherited a problem for a youth soccer league. Their standings are
computed by adding 3 columns (game_pts, ref_pts and adjust_ref_pts)
together. However, the sum of ref_pts plus adjust_ref_pts cannot exceed
15.


Here is the current query which obviously allows total_ref_pts to
exceed 15 and for total_pts to possibly be incorrect. These potential
errors are handled by PHP after the query is run and results in correct
numbers and totals being displayed.


"SELECT lname, teamno, game_pts, sport_pts, ref_pts, adjust_ref_pts,
(game_pts + ref_pts + adjust_ref_pts) AS total_pts, (ref_pts +
adjust_ref_pts) AS total_ref_pts FROM points WHERE division = 'U14B'
ORDER BY total_pts DESC"

The problem is that the sort order will occasionally be incorrect
because of total_pts being incorrect. Can the query be fixed to handle
this? If so, how? If not, that is important to know also.
Unfortunately, I don't have the luxury of being able to change the
table structure.

Using mysql 4.0.18

Thanks.

Albert Padley


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]





--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to