Archives of the TeradataForum
Message Posted: Thu, 01 Nov 2001 @ 19:12:08 GMT
Does anyone know why the INTERVAL function used in the SQL statement below does not work (I know that I can use ADD_MONTHS to achieve this but it seems unreasonable that this would generate an error):
select ('10/31/2001' (date, format 'MM/DD/YYYY')) - INTERVAL '13' MONTH
This is the error generated:
Code = 2665.
This does not generate an error:
select Add_Months(('10/31/2001' (date, format 'MM/DD/YYYY')), -13)
It would seem by the documentation that this bug was included as a "FEATURE" of ANSI SQL 99. It occurs when you are on the 31st day of a month and are going back or forward to a date with only 30 days. What kind of mathematical error would cause this??? Is there any was other than ADD_MONTHS which would NOT cause an error?
|Copyright 2016 - All Rights Reserved|
|Last Modified: 27 Dec 2016|