Dec 3rd, 2002

mysql> select sum(trial_signups) from campaign_t where datestamp='20021203'\g
+--------------------+
| sum(trial_signups) |
+--------------------+
|                 64 |
+--------------------+

Dec 4th, 2002

mysql> select sum(trial_signups) from campaign_t where datestamp='20021204'\g
+--------------------+
| sum(trial_signups) |
+--------------------+
|                100 |
+--------------------+

And a full detail of Dec 3rd shows the following (CORRECT):

mysql> SELECT site_id, sum(raws) As RawHits, sum(uniques) As UniqueHits,
sum(trial_signups) As Sales FROM campaign_t WHERE datestamp >=
'20021203' AND datestamp <= '20021203' GROUP BY site_id\g
+---------+---------+------------+-------+
| site_id | RawHits | UniqueHits | Sales |
+---------+---------+------------+-------+
|       1 |   37171 |      25137 |    31 |
|       2 |    1645 |       1010 |     0 |
|       3 |    8590 |       6353 |     1 |
|       4 |     729 |        610 |     0 |
|       5 |       2 |          2 |     0 |
|       6 |     430 |        180 |     0 |
|       7 |    2280 |       1460 |    14 |
|       8 |    2680 |       1608 |    14 |
|       9 |    3310 |       2349 |     1 |
|      10 |   17341 |       7038 |     3 |
+---------+---------+------------+-------+

Yet the same request for the next day drops a TON of records (FAILED):

mysql> SELECT site_id, sum(raws) As RawHits, sum(uniques) As UniqueHits,
sum(trial_signups) As Sales FROM campaign_t WHERE datestamp >=
'20021204' AND datestamp <= '20021204' GROUP BY site_id\g
+---------+---------+------------+-------+
| site_id | RawHits | UniqueHits | Sales |
+---------+---------+------------+-------+
|       1 |    6231 |       3672 |     1 |
|       2 |     143 |         96 |     0 |
|       3 |     256 |        128 |     0 |
|       4 |      16 |         11 |     0 |
|       6 |       9 |          9 |     0 |
|       7 |      88 |         45 |     2 |
|       8 |    1801 |       1055 |    11 |
|       9 |    2805 |       1979 |     2 |
|      10 |    2251 |        669 |     0 |
+---------+---------+------------+-------+

It's JUST the date '20021204'.. the rest of the dates (for the past 4
months) have been working fine.

Any ideas?

The simple fix is to write some code to detect if the start date equals
the end date and modify the query, but why does it work for every other
datestamp?!?  Very weird.

--

-------------------------------------------------------------------------
 Eric Anderson         Wild Web Amateurs         CyberIron Bodybuilding
  ICQ 3849549   http://www.wildwebamateurs.com  http://www.cyberiron.com
 San Diego, CA    <[EMAIL PROTECTED]>      <[EMAIL PROTECTED]>
-------------------------------------------------------------------------
 "You've got the brain and talent to do anything you want, and when you
   do, I'll be right there to borrow money from you!" -- Bart Simpson



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to