I have a SQL Query that generates the standings for local Soccer/Football and this works grand.
Teams can be deducted points for various reasons and at the moment this is a field within the teams channel.
This is the part that takes the teams deductions points field and removes them from the total points
WHEN UNIX_TIMESTAMP(NOW()) > fixture.entry_date AND fixture.status = 'open' AND fixture_data.field_id_49 = fixture_link.rel_id AND fixture_link.rel_child_id = team.entry_id AND fixture_data.field_id_50 = fixture_data.field_id_51 THEN 1
ELSE 0 END) - [b](team_data.field_id_30+team_data.field_id_53))[/b] DESC,I now have a problem that these points need to be associated per season/competition. If I start a new season then the points are deducted from the previous season. If I clear them from the team then the previous seasons standings table will be wrong too.
Any ideas how I get round this problem, thanks.