Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ORA-01861:literal does not match format string

2907166Mar 19 2015 — edited Mar 23 2015

Hi,

I am newbie to creatng reports (using Report Builder 3.0) and querying Oracle Database so please be patient with me :-)

I am trying to run the below Select query and wanted to convert the "Ticket_Creation_Date" using To_Date Function...and i encountered an error. ORA-01861:literal does not match format string...

Select TICKET_NUMBER, SEVERITY, ASSIGNEE_NAME, ASSIGNED_GROUP, REGION, COUNTRY, NAME, TICKET_STATUS, TO_DATE(TICKET_CREATION_DATE, 'DDMMYYYY HH24:MI:SS')TICKET_CREATION_DATE

from ARADMIN.Request

where REGION = 'AP'

error.jpg

Below is the table that i am querying...

| TICKET_NUMBER | SEVERITY | ASSIGNEE_NAME | ASSIGNED_GROUP | REGION | COUNTRY | NAME | TICKET_CREATION_DATE |
| R0709981 | 4 | IT_Support_1 | Service_Desk | AP | Singapore | User_1 | 1409541628 |
| R0709982 | 3 | IT_Support_1 | Service_Desk | AP | Japan | User_2 | 1411770434 |

i also tried below syntax but did not work...

Select TICKET_NUMBER, SEVERITY, ASSIGNEE_NAME, ASSIGNED_GROUP, REGION, COUNTRY, NAME, TICKET_STATUS, TO_DATE(TICKET_CREATION_DATE, 'DDMMYYYY HH24:MI')TICKET_CREATION_DATE

from ARADMIN.Request

where REGION = 'AP'

this one did not work too..

Select TICKET_NUMBER, SEVERITY, ASSIGNEE_NAME, ASSIGNED_GROUP, REGION, COUNTRY, NAME, TICKET_STATUS, TO_DATE(TICKET_CREATION_DATE, 'DDMMYYYY hh:mi')TICKET_CREATION_DATE

from ARADMIN.Request

where REGION = 'AP'

Below gave a different error:

Select TICKET_NUMBER, SEVERITY, ASSIGNEE_NAME, ASSIGNED_GROUP, REGION, COUNTRY, NAME, TICKET_STATUS, TO_DATE(TICKET_CREATION_DATE, 'DDMMYYYY')TICKET_CREATION_DATE

from ARADMIN.Request

where REGION = 'AP'

ORA-01830:date format picture ends before converting entire input string....

appreciate if you can help/guide me...

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 20 2015
Added on Mar 19 2015
21 comments
4,573 views