|
|
Archives of the TeradataForum
Message Posted: Mon, 22 Apr 2002 @ 13:30:58 GMT
Subj: | | Re: Converting 4-digit dates to standard date |
|
From: | | Paul Johnson |
You need to concatenate a '1' on the front of YYMMDD for 21st century dates in order to store them. Today as YYMMDD is 020422, which is
stored as 1020422, no matter how it's formatted when retrieved. The algorithm breaks down into the number of years since 1900, in this case
102, with MMDD, in this case 0422, concatenated onto the end. That's the non-mathematical explanation anyway.
Always, always, always store dates as a DATE data type!
Paul Johnson.
| |