heliosk
heliosk

Reputation: 1159

Convert date(varchar) and time(varchar) to datetime Oracle

How can I convert two varchar fields in Oracle to a datetime type? I have one field for date ('2014-07-19') and a field for time ('08:00'), I need this to be like '2014-07-19 08:00' in datetime Oracle.

Upvotes: 0

Views: 8481

Answers (1)

Wernfried Domscheit
Wernfried Domscheit

Reputation: 59602

Do this:

TO_DATE(DATE_COLUMN||TIME_COLUMN, 'yyyy-mm-ddHH24:mi')

Upvotes: 1

Related Questions