Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Guys,
I need to calulate the number of mothes between 2 variables start date and end date
I tried this but didn't work, any help please ?
LET vNbMois = (Year(Date#($(vDateFin), 'DD/MM/YYYY')) - Year(Date#($(vDateDebut), 'DD/MM/YYYY'))) * 12 + (Month(Date#($(vDateFin), 'DD/MM/YYYY')) - Month(Date#($(vDateDebut), 'DD/MM/YYYY')));
The formula I recommend is the following formula. Is that doesn't work, it could be the date format you proving as an input. Try, for example, to place the variables in your formula in single quotes. If still does not work, let us know what value you are getting in result and what is the value of each one of your variables.
Month(Date2) - Month(Date1) + 12 * (Year(Date2) - Year(Date1))