i have a site which i want to generate a weekly report of activity from. the monthly report should be fine as i could set the query to format the date into month and where "date" is NOW() however how can i generate a weekly report in mysql?
SELECT commission.ProductID, commission.Product, commission.ClientID, commission.ClientFirstName, commission.ClientLastName, commission.UserID, commission.Firstname, commission.Lastname, commission.Amount, commission.NPW, commission.DatePaid
GROUP BY DATE_FORMAT(commission.DatePaid,'%U') as WEEK
but it errors, can you see what i have done wrong?
what i am trying to acheive is a weekly report league table. i have a view that shows everything paid, but i would like to be able to view task activity also in this report. what woudl be the best way to query the commission table to show the top user for that week with what they have been paid?