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!

Concatenate Date and Time fields of two different types

beb7ff79-8e24-467c-b5e7-cb44183c0984Jun 16 2015 — edited Jun 16 2015

Hello,

I am attempting to combine two separate columns into a single field of type DATE. The two columns are

  • Case_Date (which is a DATE field)
  • Case_Time (which is a VARCHAR2 field of length 5)

As an example, I have the following data (notice that the Case_Time field does NOT contain seconds):

Case_DateCase_Time
3/9/201515:59

I have tried two things so far, without success:

  • to_date(Case_Date || to_date(Case_Time, 'hh24:mi'), 'mm/dd/yyyy hh24:mi:ss') --this returns a ORA-01858 error (non-numeric where numeric was expected)
  • Case_Date || to_date(Case_Time, 'hh24:mi') --this returns 09-MAR-1501-JUN-15 (because there is no date portion for Case_Time)


I have searched multiple forums, but haven't really found anything that addresses the issue of the two fields being of different data types. Any assistance would be appreciated. Thanks!

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 14 2015
Added on Jun 16 2015
2 comments
2,205 views