Where is the "Additional Instructions" field? Also, I'd like to be able to have access to the last 2,3,4,and 5 games for both league and non league

Statbook
2011-04-22 19:07

So, the "Additional Instructions" field in near the top-left of the Edit Reports window (right below the two check-boxes, "Show Totals" and "Group With Next".

To get to the Edit Reports window, either double-click on a report (or a report field) or select a report and then choose the Reports -> Edit Reports... menu item.

To have a "League" only report, you would put this text in the "Additional Instructions" field (making sure "GROUP BY p.ID" is a separate line):

Where g.GameType="League"
GROUP BY p.ID

The Pitching report would look like this:

WHERE s.pitched='1' AND g.GameType="League"
GROUP BY p.ID 

 

Let's go one step further and say you want a League report but only show the "Active" players on your roster. This would look like:

Where g.GameType="League" AND p.Active='1'
GROUP BY p.ID

The Pitching report would not need to change since an inactive player should not have pitched.

 

Now let's say you want to a report that shows the last 5 games, for League games only:

Where g.GameType="League" AND p.Active='1' AND s.gameID IN (SELECT g.id FROM games g ORDER BY g.gameNo DESC LIMIT 0,5)
GROUP BY p.ID

 

Last 2 games would look like:

Where g.GameType="League" AND p.Active='1' AND s.gameID IN (SELECT g.id FROM games g ORDER BY g.gameNo DESC LIMIT 0,2)
GROUP BY p.ID

Changed the '5' to a '2'

 

For Non-League reports, simply replace "League" in the above examples with "Non-League".

Average rating: 0 (0 Votes)

You cannot comment on this entry