Index: trunk/fundraiser-statistics/fundraiser-scripts/sql/report_campaign_totals.sql |
— | — | @@ -6,15 +6,15 @@ |
7 | 7 | faulkner.test.test_name, |
8 | 8 | drupal.contribution_tracking.utm_campaign, |
9 | 9 | sum(not isnull(contribution_tracking.contribution_id)) as donations, |
10 | | -min(receive_date) as earliest_timestamp, |
11 | | -if(not isnull(faulkner.test.test_name),1,0) as report_exists |
| 10 | +min(ts) as earliest_timestamp, |
| 11 | +if(not isnull(faulkner.test.test_name),1,NULL) as report_exists |
12 | 12 | |
13 | 13 | from |
14 | 14 | drupal.contribution_tracking left join civicrm.civicrm_contribution ON (drupal.contribution_tracking.contribution_id = civicrm.civicrm_contribution.id) |
15 | 15 | left join faulkner.test on faulkner.test.utm_campaign = drupal.contribution_tracking.utm_campaign |
16 | 16 | |
17 | | -where receive_date >= %s and receive_date < %s |
| 17 | +where ts >= '%s' and ts < '%s' |
18 | 18 | |
19 | 19 | group by 2 |
20 | | -order by 3 desc; |
| 20 | +order by 4 desc; |
21 | 21 | |