WHERE to_char (REPORTDATE, 'DD.MM.YYYY')> '09 .11.2013 '
You are comparing two STRINGS . You need to compare DATE . As I said in another answer here, you need to leave the date the same as for DATE calculations. TO_CHAR is for display, and TO_DATE is for converting a string literal to DATE.
SELECT TO_CHAR(REPORTDATE, 'DD.MM.YYYY'), COUNT(*) FROM TABLE WHERE REPORTDATE > TO_DATE('09.11.2013', 'DD.MM.YYYY') GROUP BY TO_CHAR(REPORTDATE, 'DD.MM.YYYY')
In addition, REPORTDATE is a DATE column, so it will have a datetime element. So, if you want to exclude the time element when comparing, you need to use TRUNC
WHERE TRUNC(REPORTDATE) > TO_DATE('09.11.2013', 'DD.MM.YYYY')
However, when using TRUNC in a column any regular index in this column will be suppressed. In terms of performance, it is better to use the date range condition .
For instance,
WHERE REPORTDATE BETWEEN TO_DATE('09.11.2013', 'DD.MM.YYYY') AND TO_DATE('09.11.2013', 'DD.MM.YYYY') +1
source share