1 year ago

#307265

test-img

Bikash

Teradata Date format converion from varchar to date

I'm stucked somewhere in Teradata date conversion. Can anyone please help, thanks in advance.

Table name is Test2 Table attributes are defined as:

Acct_id    Integer,
Date_num   Varchar(10) Character set Latin not casespecific

Sample Data:

Acct_id   date_num
 234124 2012-03-04
 342123 2021-04-06

When trying to cast date_num in date format getting error: Invalid date

Tried below query: Select Acct_id, to_date(Date_num, 'YYYY-MM-DD') AS DT FROM ACCT_LOAD.TEST2

I want the date to be in correct date format so I can load to another table where column attributes are defined as date.

sql

teradata

teradata-sql-assistant

teradatasql

0 Answers

Your Answer

Accepted video resources