please have a look at the attached picture..
Neither "ORDER BY" nor "TO_CHART" functions are working properly on DATE type.