Reputation: 57
My T SQL -
left(convert(char,Month,111),7) "Year-Mon"
Below is the error I'm getting Error: invalid identifier 'CHAR'
Upvotes: 1
Views: 75
Reputation: 7387
You can use this
to_char(to_date(Month,'yyyy/mm/dd'),'yyyy-mm') "Year-Mon"
From your question, I assumed,
Month
is a string in yyyy/mm/dd format.
And you are expecting a string in yyyy-mm format.
Upvotes: 1