|
Archives of the TeradataForumMessage Posted: Wed, 13 Sep 2006 @ 16:03:49 GMT
The answer to that depends on whether your source column is a character/date column and whether you are querying from Teradata utils or ODBC This one is sufficient for a Date source column from a teradata utility SELECT DT1 (FORMAT 'YYYYMMDD') FROM JOE_001_D01.MY_DT001; You will have to do this extra trick if you are querying from ODBC SELECT CAST ( (DT1 (FORMAT 'YYYYMMDD')) AS CHAR(8) ) FROM JOE_001_D01.MY_DT001; Now if your source column was character format, then this is what you should do from a terdata utility SELECT CAST(DT2 AS DATE FORMAT 'YYYY-MM-DD') (FORMAT 'YYYYMMDD') FROM JOE_001_D01.MY_DT001; And this one is for ODBC SELECT CAST( (CAST(DT2 AS DATE FORMAT 'YYYY-MM-DD') (FORMAT 'YYYYMMDD')) AS CHAR(8)) FROM JOE_001_D01.MY_DT001; Regards Joseph Vinish D'silva
| ||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||
Copyright 2016 - All Rights Reserved | ||||||||||||||||||||||||||||||||||||||||||||||||
Last Modified: 15 Jun 2023 | ||||||||||||||||||||||||||||||||||||||||||||||||