![]() |
|
Archives of the TeradataForumMessage Posted: Fri, 29 Feb 2008 @ 20:47:20 GMT
Oh David, you were so close with the date math, however the year is stored as an offset from the year 1900. This year is 108 + 1900 = 2008. So you would need to do this for current year:
(current_date/10000+1900) * 10000 + 1231 (date)
or for prior year:
(current_date/10000+1899) * 10000 + 1231 (date)
Now, with all this said, if he really is trying to back up one year, why not do this:
add_months(store_year,-12)
It just depends if he is backing up one year or one day in that goofy looking Oracle code using all those functions (my opinion of course...lol) Regards, Michael Larkins
| ||||||||||||||||||||||||||||||||||||||||||||||||
| | ||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||
| Copyright 2016 - All Rights Reserved | ||||||||||||||||||||||||||||||||||||||||||||||||
| Last Modified: 15 Jun 2023 | ||||||||||||||||||||||||||||||||||||||||||||||||