Representing dates earlier to 1900???

Database
Enthusiast

Representing dates earlier to 1900???

Hi there,

is it possible to have a date in TD earlier to 1900?
my understanding is 010101 -> represents 01-Jan-1901.
any expln pls?
2 REPLIES
Senior Apprentice

Re: Representing dates earlier to 1900???

Hi SarathyG,
of course it's possible, the valid date range is from 0001-01-01 to 9999-12-31

010101 -> 01-Jan-1901
0101 -> 01-Jan-1900
-9899 -> 01-Jan-1899 :-)

Teradata stores dates using following formula:
(year - 1900) * 10000
+ month * 100
+ day

Btw, the recommended way according to Standard SQL is
DATE '1899-01-01'

Dieter
Enthusiast

Re: Representing dates earlier to 1900???

Excellent. Thx a lot. i was jst thinkin of, hw d TD store -ve nums n all. lemme try some combi in DB.:-) thx a lot again. :-)