mysql database. Table is called transactions
Amount | Date(yyyy-mm-dd) | Category
---------------------------------------
23.00 | 2006-05-06 | category1
34.32 | 2006-07-06 | category2
234.23 | 2006-01-01 | category1
12.31 | 2006-05-19 | category3
41.12 | 2006-05-31 | category2
So I want to be able to Sum up all the values from amount for a particular category and for a certain month + year.
Have this but it is not working
SELECT SUM(`Amount`),`Category`,`Date` FROM `transactions` WHERE `Category` = 'Gas' GROUP BY `Category` and `Date` > 20060701 and `Date` < 20060731;
Amount | Date(yyyy-mm-dd) | Category
---------------------------------------
23.00 | 2006-05-06 | category1
34.32 | 2006-07-06 | category2
234.23 | 2006-01-01 | category1
12.31 | 2006-05-19 | category3
41.12 | 2006-05-31 | category2
So I want to be able to Sum up all the values from amount for a particular category and for a certain month + year.
Have this but it is not working
SELECT SUM(`Amount`),`Category`,`Date` FROM `transactions` WHERE `Category` = 'Gas' GROUP BY `Category` and `Date` > 20060701 and `Date` < 20060731;