|
|
Archives of the TeradataForum
Message Posted: Thu, 28 Jun 2007 @ 21:13:24 GMT
Subj: | | How to get 5 digit month diff |
|
From: | | Kopuuravuri, Ramu |
Looks like if number of months between two dates is greater than 4 digit, then this would not work. Any work around?
select CAST (((( CURRENT_DATE - EXTRACT( DAY FROM CURRENT_DATE ) + 1)
- (date '3000-12-31' )) MONTH (4)) AS INTEGER )
;
select CAST (((( CURRENT_DATE - EXTRACT( DAY FROM CURRENT_DATE ) + 1)
- (date '2020-12-31' )) MONTH (4)) AS INTEGER )
;
Regards,
Ramu.
| |