Hello,

I am trying to build a sql statement for MySQL 4.0.x which does count the accumulated total entries in a table per day since a specified start date.

For example:
Day 1 = 10
Day 2 = 12
Day 3 = 9

The statement I am using gives back the entries per day, starting each day with 0.
For example:
Day1 = 10
Day2 = 2
Day3 =0 (-3)

code:
SELECT DATE_FORMAT( timestamp, '%Y%m%d') AS mydate,
       count(*) AS ct,
       ID
FROM $DB.$T4
   WHERE
           (timestamp >= '$date_start'
       AND
           timestamp <=  '".$date_end."235959')
       AND
           confirmed = '1'
   GROUP BY
       mydate

Has anybody an idea how to recraft the statement to get the accumulated entries per day?

Thank you for any help,

Alexandra

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to