I need to convert string from varchar to Date in 'MM/DD/YYYY' format. My input string is '4/9/2013' and my expected output is '04/09/2013'. i.e. 2 digit month, 2 digit date and 4 digit year seperated by'/'
I have below data: DOJ varchar2(10 Byte)column has '4/9/2013' value. I am using 'select TO_DATE(DOJ,'MM/DD/YYYY') from EmpTable. But I am getting result as 09-APR-13. I want it in 04/09/2013 format.
Please advise. Thanks in advance.
DATE
has no format, if just converts to a specific format when you ask the database or application to display it. If you need a specific formatted date, you need to convert fromvarchar
tovarchar
instead. – Joachim IsakssonTO_DATE(SUBSTR(DOJ, 1, 11), 'dd/mm/rrrr')
with oracle sql 11g – KingRider