The ADD_MONTHS function provides for adding or subtracting months or years, handling the variable number of days involved.