Hi There,
I have a query where I would like it to SUM up the last 7 days of records. Further, It needs to start a new week on Monday. The 'time_upload' field is a datetime field. What am I doing wrong or not doing here ? At the moment it sums up all rows.
SELECT SUM(distance), DATE_FORMAT(time_upload, '%u') FROM TRAININGLOG WHERE DATE_SUB( NOW(),INTERVAL 7 DAY ) <= time_upload
Any help will be appreciated.
Thanks, CH