|
|
Archives of the TeradataForum
Message Posted: Mon, 10 Nov 2003 @ 22:13:07 GMT
Subj: | | Re: Format of Date |
|
From: | | Anantaraman, Kumaran (K.) |
Pat Belle wrote
| The double parens presumably conceal the format phrase from the ODBC parser. It ought to be possible to drop the typecast and the
char(8), but I haven't been able to get it to work doing that. | |
Its not the double parenthesis that conceals the format phrase. It is because, after casting to char(n) by Teradata server (which
follows the format phrase), ODBC now sees a CHAR data type, as opposed to a DATE data type.
ODBC clients follow certain rules on how to display each data type. A DATE is displayed as YYYY-MM-DD. A CHAR is displayed as is.
SELECT
(CAST(date AS DATE FORMAT 'MMDDYYYY')) (char(10)) as ODBC_sees_char_type,
date as ODBC_sees_date_type
;
| |