the orginal query:
SELECT DelMonth, DelDay, DelYear, Count(DelDate) AS countOfDelDate
FROM mytbl
WHERE item LIKE '70%-113%' OR item LIKE '73%-113%'
GROUP BY DelMonth, DelDay, DelYear
HAVING DelDay=21 AND DelMonth=02 AND DelYear=2014
The original query i have above is actual select each fields from the table. I need to re-write this by select M, D, Y from the deliverydate but got an error. What did i have wrong here, can you plz help?
thanks
Modified:
Select
day(delDate) as del_d,
month(delDate) as del_m,
year(delDate) as del_y
FROM mytbl
WHERE item LIKE '70%-113%' OR item LIKE '73%-113%'
group by del_d,del_m,del_y
having del_d = 21
and del_m =02
and del_y = 2014