2

I have a column with values as below .Data type is 'Text'

 Check-in

 26Nov2017
 09Jun2017
 19Jan2018

I am trying to convert into specific format

Check-in

Nov-17
Jun-17
Jan-18

I am getting type explicit error when i try writing as

 select Check-in,to_date(Check-in,'Mon-YY') as Check-in_updated from my_table;

1 Answer 1

2

First you need to convert it into date explicitly using CAST()

Demo

SELECT TO_CHAR(cast(Check-in as date), 'Mon-YY')

Output:

Nov-17
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.