4 Replies Latest reply: Aug 1, 2017 7:37 AM by Sunny Talwar

# Months between 2 dates

I have 2 date fields "Hire date" and "Report date"

I want to calculate the number of employees who have joined in last six months from the report date.

How do we calculate the months b/w 2 dates.

for eg-

Report date is 30/6/2017 and hire date is 30/12/2016 it should give me 6 as answer

• ###### Re: Months between 2 dates

maybe this

'month(Report date)-month(Hire date)

• ###### Re: Months between 2 dates

I have tried this but it doesn't return the correct value if the year is different

• ###### Re: Months between 2 dates

=(year(today())-year(hiredate))*12                              // number of years * 12

+( num(month(today()))-num(month(hiredate)))          // + number of months

+1                                                                                // plus 1

Regards

• ###### Re: Months between 2 dates

You need to count people who joined between 1/1/2017 and 30/6/2017?

May be this

Count(DISTINT {<DateField = {"\$(='>=' & Date(MakeDate(2017, 1, 1), 'D/M/YYYY') & '<=' & Date(MakeDate(2017, 6, 30), 'D/M/YYYY'))"}>} EmpID)