coppro wrote: > On Tue, Nov 17, 2009 at 4:17 PM, Ed Murphy <emurph...@socal.rr.com> wrote: >> To be more specific: Â Each draws_by_week.php script works correctly, as >> far as it goes. Â What they is a "leave out data more than X weeks old" >> cutoff; instead, they include every week from (hardcoded start date) to >> (end of the most recent week that has already ended). Â If you just go >> by my published reports, then you can ignore this problem (I'll manually >> trim the published list). > > Ah... couldn't you limit the query to WHERE date > DATE_SUB(UTC_NOW(), > 1 MONTH) or something like that (disclaimer: I may have the functions > and/or syntax wrong).
The detail script (draws.php) has a 30-day cutoff, but doing that in the summary script would generally cut off mid-week. The messy corner case occurs when the time period crosses a year boundary. Thinking about it, I should be able to make it Good Enough later on, basically (same year and week# >= current week# - 5) or (previous year and week# >= 49 and current week# <= 5)