ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

SQL Query help with Leagues Standings and points Deductions

March 06, 2012 7:15am

Subscribe [1]
  • #1 / Mar 06, 2012 7:15am

    Scott Boyde

    208 posts

    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.

     

     

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases