Date Format

Tools
N/A

Date Format

I am currently having difficulty formatting the following date 04/01/2007 so that it outputs 04 January 2007.

select CAST(date AS DATE FORMAT 'dd-mmmm-yyyy') AS my_new_dt

Any suggestions gratefully received!
2 REPLIES
N/A

Re: Date Format

- I've managed to get the desired output by using the following:

select CAST(CAST(date AS DATE FORMAT 'DD-MMMM-YYYY') AS CHAR(20))

N/A

Re: Date Format

Teradata as far as I know wont store a date internally in that format but you can display the date in the format you have already mentioned.

SELECT CAST (CAST (CURRENT_DATE AS DATE FORMAT 'DD-MMMM-YY') AS VARCHAR(20))
;