I'm trying with following query, it is giving me the correct date format but dates are not sorted correctly.
select to_char(date_of_service, 'mm/dd/yyyy') as service_date
from cases
order by service_date
Result I'm getting something like this (sample).
"01/01/2005"
"01/01/2010"
"01/02/2005"
"01/02/2010"
After date format I think it is getting converted into string and due to that sorting is not working. Any alternate solution available for this?
order by date_of_service