This content has been marked as final. Show 7 replies
If you just want to dispaly format, then try
Select To_CHar(Datefile, 'DD-MM-YYYY') , TO_CHAR(DATEFILED1, 'MM-DD-YYYY') FROM TABLE NAME.
But your Titile and your question is not cleare..
hello i have to convert my date i. e. in dd/mm/yyyy format from 04/10/2013 to 10/04/2013.
pl temm me how to do it.....
Oracle stores the date field as mm/dd/yyyy format only in DatabaseNo, mm/dd/yyyy is a display format. The internal storage has no formatting except the ordering of bytes used to store the information.
So when the date is stored in a DATE column, then the display format is defined by the session settings
or by passing a format mask in TO_CHAR.
SELECT * FROM nls_session_parameters WHERE parameter = 'NLS_DATE_FORMAT'
In Forms you can define a format mask on a date field in the item properties.
A completly different thing would be if the date is stored in a VARCHAR2 column. While it is a very bad practice that can lead to a lot of corrupt data we can find it much too often.
In this case you could do
But don't do this, when the column is defined as DATE!!
Now I understood your point.
My advice is do not make any change on the database , let it as it is.
You apply all your restriction and validation in your front end forms. This will solve your doubt
i have to convert date 04/10/2013 to 10/04/2013 explicitly in my database . dates are in dd/mm/yyyy.
because of some mistakes it happens that instead of 10/04/2013 we save it 04/10/2013.