offset_months

offset_months function adds months to the month component of date, if the resulting month doesn't have enough days for the day component, the last day of the new month is returned.

Syntax

offset_months(date(year, month, day), months)

Parameters

  • date can be any of the following:
    • Another function that returns a date.
    • A formula column that returns a date.
  • year: 4 digits.
    For example, 2012
  • month: 2 digits.
    For example, 01 or 12
  • day: 2 digits.
    For example, 01 or 30
  • months:
    • Positive: Counts forward
    • Negative: Counts backward

Examples

offset_months(date(2020,12, 25), 5) returns May 25, 2021

Related links

Was this helpful?

How can we improve it?

Need more help?

Try these next steps:

true
Search
Clear search
Close search
Main menu
17392959498670695291
true
Search Help Center
true
true
true
true
true
5055977
false
false