benny
benny

Reputation: 17

Convert 17-jun-87 to '17-jun-1987 21:55:45'

table x

Hire_date

17-jun-87

how to convert it to '17-jun-1987 21:55:45' ?

I tried couple ways using to_char function or to_date function but getting some error

select to_char(hire_Date, 'dd-mmm-yyyy hh24:mi:ss') but was not successful ?

any suggestions please?

Upvotes: 0

Views: 119

Answers (2)

Jens
Jens

Reputation: 69440

Use:

select to_char(hire_Date, 'dd-MON-yyyy hh24:mi:ss')

Upvotes: 1

Siberia
Siberia

Reputation: 137

The problem is that you have mmm instead of mon

select to_char(hire_Date, 'dd-mmm-yyyy hh24:mi:ss')

change it to

select to_char(hire_Date, 'dd-mon-yyyy hh24:mi:ss')

should work

Upvotes: 0

Related Questions