I have REPORTDATE
column in database (DATETIME
) type.
I want to extract only DATE
value from the DATETIME, then to do COUNT
for each day and to put WHERE
clause to restrict only dates later than some specific date.
So I have this clause:
SELECT to_char(REPORTDATE, 'DD.MM.YYYY') AS MY, COUNT(*) from INCIDENT
where to_char(REPORTDATE, 'DD.MM.YYYY')>'09.11.2013'
GROUP BY to_char(REPORTDATE, 'DD.MM.YYYY')
It returns me results but but I can notice wrong result such as : 30.10.2013
which is wrong result.
How to solve this?