to_char(to_date('31/12/2013', 'dd/mm/yyyy'), 'yyyymmdd') why it doesn't wor
516988Mar 17 2008 — edited Mar 17 2008I have the following table (this is a sample so I don't have to send you my entire (code):
create table x (a date);
When I try to insert the following date with format 'yyyymmdd') I am getting the following error message:
ORA-01861 literal does not match format string
insert into x
SELECT DISTINCT
to_char(to_date('31/12/2013', 'dd/mm/yyyy'), 'yyyymmdd')
from dual
Can someone tell me what I am doing wrong? Please do not tell me to change the column to char because I know this will work but it has to stay as date datatype...