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!

need help converting military time to standard time

480000Jan 2 2006 — edited Jan 2 2006
Hi all,
I have a query that tries to format military time as standard time but it fails. Does anyone have experience doing this??

Below is the query and error message:

(select transaction_id, to_date(contact_date || ' ' || contact_time, 'MM/DD/YYYY HH:MI:SS AM')
*
ERROR at line 2:
ORA-01849: hour must be between 1 and 12

***** Table t_fcg holds some contact times stored as varchars as military time ******

(select transaction_id, to_date(contact_date || ' ' || contact_time, 'MM/DD/YYYY HH:MI:SS AM')
from t_fcg where cust_no is not null and transaction_id is not null);

**************************************************************************************************

Thanks,
David Aguillard
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 30 2006
Added on Jan 2 2006
3 comments
1,760 views