I have the following SQL statement that works to get the total for the last 12 months.
How do I modify this to give me the total of THIS year only…and not go back 12 months. The statement creates a bar chart for me and I am only interested in this years results.
$sql = “SELECT YEAR(date) AS year, MONTH(date) AS month, SUM(amount) AS total FROM income WHERE date > DATE_SUB(NOW(), INTERVAL 1 YEAR) GROUP BY year, month”;