{"id":1879,"date":"2019-11-22T12:42:56","date_gmt":"2019-11-22T12:42:56","guid":{"rendered":"http:\/\/www.theSQLReport.com\/?p=1879"},"modified":"2019-11-22T12:46:23","modified_gmt":"2019-11-22T12:46:23","slug":"teradata-convert-timestamp-to-the-month-of-the-year","status":"publish","type":"post","link":"https:\/\/www.theSQLReport.com\/?p=1879","title":{"rendered":"Teradata \u2013 Convert Timestamp to the Month of the Year"},"content":{"rendered":"<p>This one also surprises me that someone has not already posted.<\/p>\n<p>The TD_Month_Of_Year function returns an integer value that need to converted to string value.\u00a0 Careful when using this on a large data set, it can really slow down the response time.<\/p>\n<pre>select\r\n\r\ntd_month_of_year(current_date),\r\n\r\nCASE\r\n\r\ntd_month_of_year(current_date)\r\n\r\nWHEN 1 THEN 'January'\r\n\r\nWHEN 2 THEN 'February'\r\n\r\nWHEN 3 THEN 'March'\r\n\r\nWHEN 4 THEN 'April'\r\n\r\nWHEN 5 THEN 'May'\r\n\r\nWHEN 6 THEN 'June'\r\n\r\nWHEN 7 THEN 'July'\r\n\r\nWHEN 8 THEN 'August'\r\n\r\nWHEN 9 THEN 'September'\r\n\r\nWHEN 10 THEN 'October'\r\n\r\nWHEN 11 THEN 'November'\r\n\r\nWHEN 12 THEN 'December'\r\n\r\nEND AS \"Month of the Year\"\r\n\r\n<\/pre>\n<p><a href=\"http:\/\/www.theSQLReport.com\/wp-content\/uploads\/2019\/11\/Teradata_Month_ofthe_Year.jpg\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-1875 size-full\" src=\"http:\/\/www.theSQLReport.com\/wp-content\/uploads\/2019\/11\/Teradata_Month_ofthe_Year.jpg\" alt=\"Teradata Convert Timestamp to Month of the Year\" width=\"411\" height=\"721\" \/><\/a><\/p>\n<p>Note: If you know of a native Teradata function that does this, please leave me note in the comments.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This one also surprises me that someone has not already posted. The TD_Month_Of_Year function returns an integer value that need to converted to string value.\u00a0 Careful when using this on &hellip; <a class=\"readmore\" href=\"https:\/\/www.theSQLReport.com\/?p=1879\">Continue Reading &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":1875,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[54],"tags":[175,173,174],"class_list":["post-1879","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-teradata","tag-month-of-the-year","tag-td_month_of_year","tag-timestamp"],"_links":{"self":[{"href":"https:\/\/www.theSQLReport.com\/index.php?rest_route=\/wp\/v2\/posts\/1879"}],"collection":[{"href":"https:\/\/www.theSQLReport.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.theSQLReport.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.theSQLReport.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.theSQLReport.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1879"}],"version-history":[{"count":6,"href":"https:\/\/www.theSQLReport.com\/index.php?rest_route=\/wp\/v2\/posts\/1879\/revisions"}],"predecessor-version":[{"id":1888,"href":"https:\/\/www.theSQLReport.com\/index.php?rest_route=\/wp\/v2\/posts\/1879\/revisions\/1888"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.theSQLReport.com\/index.php?rest_route=\/wp\/v2\/media\/1875"}],"wp:attachment":[{"href":"https:\/\/www.theSQLReport.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1879"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.theSQLReport.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1879"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.theSQLReport.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1879"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}