MONTHSTO

Returns the number of whole months between two given dates. For some specific dates careful consideration should be given. For example if supplied with the 31st Jan and the 28th of Feb the function will return zero as effectively it is not a whole months difference.

MONTHSTO ( <date_field> , <date_field or date> )
  • Date_Field: The first date field to use in the calculation

  • date_field or Date: A second date to use in the calculation.

Note: dates in Audiences need to be formatted as either YYYY-MM-DD or MM/DD/YYYY. Entering a date as 01-02-2023 would be read as Jan-2 not 1-Feb.

Example: create a field on the CUSTOMER table that returns the number of months since a customer has made a purchase.

MONTHSTO(CUSTOMER.LASTEST_PURCHASE_DATE,_TODAY)