I know that there have been several posts related to this, but my case is a little different, and I would like to help with this.
I need to pull some data from a database, which is the cumulative number of interactions by day. this is now what i
SELECT e.Date AS e_date, count(e.ID) AS num_interactions FROM example AS e JOIN example e1 ON e1.Date <= e.Date GROUP BY e.Date;
The result of this is close to what I want, but not exactly what I need. The problem I am facing is dates that are stored with the hour minute and second when the interaction occurred, so the group does not group the days together.
this is what the conclusion looks like. http://screencast.com/t/N1KFNFyil on 12-23 theres 5 interactions, but its not grouped because the time stamp is different. so I need to find a way to ignore the timestamp and just look at the day.
if I try GROUP BY DAY(e.Date) , it only groups the data by day (i.e. everything that happened on the 1st of any month is grouped on one line), and the output is not what I want generally http://screencast.com/t/HN6DH3GV63M
GROUP BY DAY(e.Date), MONTH(e.Date) splits it into a month and a day of the month, but again the account is turned off.
I'm not a MySQL expert at all, so I'm puzzled by what I am missing
date mysql group-by
John ruddell
source share