I have REPORTDATE column in database (DATETIME) type.
I want to extract only DATE value from the DATETIME, then to do COUNT
The condition to_char(REPORTDATE, 'DD.MM.YYYY')>'09.11.2013' compare to strings, so 30.10.2013 is after 09.11.2013.
You need to compare the dates, not the string values, so you have to change your query to the following.
SELECT to_char(REPORTDATE, 'DD.MM.YYYY') AS MY, COUNT(1)
from INCIDENT
where trunc(REPORTDATE)> to_date('09.11.2013', 'DD.MM.YYYY')
GROUP BY to_char(REPORTDATE, 'DD.MM.YYYY')
Note: I added a little modification from count(*) to count(1) for optimize the query having the same results.