17.00 - 17.05 - ADD_MONTHS Summarized - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL Date and Time Functions and Expressions

Product
Advanced SQL Engine
Teradata Database
Release Number
17.00
17.05
Release Date
June 2020
Content Type
Programming Reference
Publication ID
B035-1211-170K
Language
English (United States)

ADD_MONTHS returns a new date_expression or timestamp_expression with YEAR and MONTH fields adjusted to provide a correct date, but a DAY field adjusted only to guarantee a valid date, which might not be a date you expect intuitively.

If this behavior is not acceptable for your application, use ANSI SQL:2011 DateTime interval arithmetic instead. For more information, see ANSI Interval Expressions.

Remember that ADD_MONTHS changes the DAY value of the result only when a non valid date_expression or timestamp_expression would otherwise be reported.