From what i understood .... you need to CAST both columns to VARCHAR and concatenate (using ||) to get the desired output.
CAST(Month_Name as VARCHAR(10)) || CAST(Year_of_Calender as VARCHAR(4))
Many Thanks Adeel, It has worked.
But i am interest in the last two parts of the year say '12 rather than 2012 for the year part.
You just need to substr like below:
CAST(Month_Name as VARCHAR(10)) || substr(CAST(Year_of_Calender as VARCHAR(4)), 3,2)
and in case you need ' .... you should use following:
CAST(Month_Name as VARCHAR(10)) || '''' || substr(CAST(Year_of_Calender as VARCHAR(4)), 3,2)
Adeel you are a STAR mate, that has worked like a treat. Thanks a ton!!
As i have mentioned i am new to teradata or any other databases. can you please send a few reference docs or any other resources i can refer to?
Welcome Raja .... regarding material you can search on the web and visit www.teradata.com for details.
In my opinion practicing is the best option .... and you need to have a documentation handy to read and learn more about Teradata.
in a calendar table there's a date column, too.
You might use it instead and simply apply a FORMAT:
cast(cast(calendar_date as format 'mmm''yy') as char(7))