Teradata Default date format Issue.

UDA
Fan

Teradata Default date format Issue.

Hi All,

When I use SQL query for selecting current timestamp. Teradata is not not returning ISO format like "YYYY-MM-DDBHH:MI:SS"

SQL: SELECT CURRENT_TIMESTAMP;

Programming Language: ASP, ADO

ODBC: Teradata v12.1 (TTU v12)

I guess problem is with teradata ODBC driver. So that recordset not returning teradata timestamp format.

3 REPLIES
Enthusiast

Re: Teradata Default date format Issue.

Have you tried using a format clause on your SELECT to return it in the format desired?

SELECT CAST(CURRENT_TIMESTAMP(0) AS TIMESTAMP(0) FORMAT 'YYYY-MM-DDBHH:MI:SS');
Teradata Employee

Re: Teradata Default date format Issue.

Teradata is returning the TIMESTAMP in the binary format specified by the API, and your application is formatting it on the client side.

If you prefer Teradata to do the display formatting before returning the value to the client, CAST the field to CHAR or VARCHAR.
Fan

Re: Teradata Default date format Issue.

Thank you! I have used CAST function. It works!.