-1

I have column name PERIODE with dd-MON-yyyy format and I want to change it to dd-mm-yyyy format, already tried some function but the format didn't changed

Michael
  • 1
  • 5
  • Use [TO_CHAR](https://docs.oracle.com/cd/B19306_01/server.102/b14200/functions180.htm) – Maciej Los Jul 15 '21 at 06:28
  • can you give me example? – Michael Jul 15 '21 at 06:29
  • Follow the documentation. There's tons of examples! – Maciej Los Jul 15 '21 at 06:30
  • 2
    What is the data type of the `periode` column? If it is a sensible data type, `date` or one of the `timestamp` data types, it does not have a format. And thus you cannot change the format. You could write a query that returns a `varchar2` data type in a particular format. If the column is a `varchar2` then you have the wrong data type. You could convert the existing string to a date and then to another string in a different format but you really should fix the data model. – Justin Cave Jul 15 '21 at 06:34
  • okay its make sense now thankyou for the answer :D – Michael Jul 15 '21 at 06:35
  • You can change the default _display_ format for any DATE column in SQL Developer. Might be easier than using to_date() in every query you run. –  Jul 15 '21 at 08:49

1 Answers1

1

try it

select to_char(v_date_type, 'dd-mm-yyyy') from dual;
Hung Le
  • 141
  • 9