Date format - FMDD?

Database

Date format - FMDD?

In oracle, if date format is set to be "dd-mm-yyyy" -> 01-12-2006
if it's set to be "fmdd-mm-yyyy" -> 1-12-2006.

But how about in teradata......i wanna to use the function like 'fmdd', how to make it?
1 REPLY
Enthusiast

Re: Date format - FMDD?


The query helps in getting the desired output but the string format not able to convert back to date.

select
CASE
WHEN SUBSTRING(CAST(DATE -11 AS FORMAT 'DD') FROM 1 FOR 1 ) = 0 THEN
SUBSTRING(CAST(DATE -11 AS FORMAT 'DD-MM-YYYY') FROM 2)
ELSE
SUBSTRING(CAST(DATE -11 AS FORMAT 'DD-MM-YYYY') FROM 1)
END
;