Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
If I have two dates 02/21/2017 & 01/26/2018, how could I get the number of months between these two dates?
I prefer to define a MonthSequence field in my master calendar.
...
Year(calDate) * 12 + Month(calDate) as MonthSequence,
...
In that case difference in months is simply the difference of the two month sequences.
If you want to do this in an expression, then you can do something similar
=(Year(date1) * 12 + Month(date1)) - (Year(date2) * 12 + Month(date2))
Hi Wanyun,
You can use below expression to get number of months between these two dates.
=Round((date#(01/26/2018) - date#(02/21/2017))/30,0)
Regards,
Akshaya
PS - if you find this as correct/helpful, mark it as Correct/Helpful.
May be:
Interval(End_Date-Start_Date,'MM')
FLOOR(INTERVAL(DATE(DATE#('01/26/2018','MM/DD/YYYY'),'DD/MM/YYYY')-DATE(DATE#('02/21/2017','MM/DD/YYYY'),'DD/MM/YYYY'),'D hh:mm')/30)
I prefer to define a MonthSequence field in my master calendar.
...
Year(calDate) * 12 + Month(calDate) as MonthSequence,
...
In that case difference in months is simply the difference of the two month sequences.
If you want to do this in an expression, then you can do something similar
=(Year(date1) * 12 + Month(date1)) - (Year(date2) * 12 + Month(date2))