Date Function

Analytics
Fan

Date Function

I want select month name and date from a date column. For Ex. My output should be '15-JAN'. Plz help me how to do it in Teradata, coz i am new to it.
5 REPLIES
Enthusiast

Re: Date Function

You can do that like this:

Select date_col (format 'DD-MMM') (CHAR(6))
...

Fan

Re: Date Function

Thanks Barry... :-)

Re: Date Function

When I copy/paste this dataset to excel, my years are completely messed up. For example, I have a field value = 12/01/12 being formatted with 'mmm-yy' and Teradata is returning Dec-12, but when I export it to excel ,it shows Dec-12. Any suggestions?

Supporter

Re: Date Function

specify four digist years! There will be always confusion how it should be interpreted...

Dec-12 can be Dec 2012 or 12 day of December...

Never format a year with 2 digits ;->

Junior Contributor

Re: Date Function

I agree, it's completely messed up:

"Teradata is returning Dec-12, but when I export it to excel ,it shows Dec-12"

;-)

Dieter