I'm trying to calculate the end of a contract. I have a date field and a duration field in months, in some cases are years (24, 36, 48 months)
I'm trying "the Excel way" adapted to QGIS.
Excel way:
=DATE(YEAR(A2), MONTH(A2)+A3, DAY(A2)) My QGIS code:
make_date( year("DATE"), month("DATE") + "DURATION", day("DATE") ) This works only when my Date month + Duration are less than 12; otherwise, the expression is invalid.
I can make and if Duration > 12 create a variable year=(Duration//12) and another variable month_r=(Duration%12) but I still have the problem that if my base Date is in December if I add 1 month the function will fail.

