sql statement to convert hundred year date to yyyy-mm-dd format

Database
Enthusiast

sql statement to convert hundred year date to yyyy-mm-dd format

hi ,

i need to write a sql statement to convert hundred year date to 'yyyy-mm-dd' format

for example a hundred year date 40196 is equal to 2010-01-19

can any one give me an idea how to do this using sql statement in teradata...

thanks
1 REPLY
Enthusiast

Re: sql statement to convert hundred year date to yyyy-mm-dd format

I presume these dates are the number of days since Jan 1st, 1900.

So:

select Date '1900-01-01' -1 + 40196
;

gives you 19th Jan 2010.