|
Archives of the TeradataForumMessage Posted: Thu, 19 Jun 2003 @ 19:14:18 GMT
On Wed, 18 Jun 2003 11:35:15 -0500, Geoffrey Rommel wrote:
Hi, Intervals may not handle month calculations correctly. If you do date '2003-08-30' - INTERVAL '6' MONTH It will generate 2003-02-30 which is an invalid date and the query will fail. The second suggestion add_months is a TERADATA extension to the ANSI standard. It doesn't suffer from this because Teradata defined it to handle this correctly by reverting the invalid date to the closest valid date. Therefore for my example add_months(date '2003-08-30',-6) would give 2003-02-28 which is valid and the query will work.
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Copyright 2016 - All Rights Reserved | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Last Modified: 15 Jun 2023 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||