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!

to_date format error

2752222Nov 11 2014 — edited Nov 17 2014

so i got this date formatted from one of my tables:

select to_char(a_timestamp_field, 'yyyy/mm/dd:hh:mi:ss.ff') (the date field is timestamp(3))

it returns this date:

4638/01/01:12:00:33.690

but when I try to format that into a date using the same format:

where some_timestamp(3)_field = to_date('4638/01/01:12:00:33.690','yyyy/mm/dd:hh:mi:ss.ff3')

I get an error:

SQL Error: ORA-01821: date format not recognized

I thought I was using the same format I used to get a result to format the result into a date to use

in a new query, I just changed the 'ff' to 'ff3' to let the format function know i am sending 3 chars for the fraction of a second

can't find whats wrong with this

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 15 2014
Added on Nov 11 2014
14 comments
5,256 views