pastorandy
IS-IT--Management
I would like to be able to pass a Month like 'Jan' which is a datetime field in a table called sales from a mysql db and pull back all sales for Jan 2007.
I can't get the following hard coded month to bring back the sales it's just empty.
Any ideas?
I can't get the following hard coded month to bring back the sales it's just empty.
Code:
SELECT Date_Format(order_date, 'mmm') AS monthDate, SUM(set_cost) AS set_cost2 from sales
WHERE order_date = 'Jan'
GROUP by monthDate";
Any ideas?