You need to sign in to do that
Don't have an account?
Sagar Madkaikar
Find Difference Between 2 Dates in Months and Days
Hi,
I have a requirement where we need to find the difference between 2 different Date fields.
1. Start_Date__c.
2. End_Date__c.
We want to Store the Month difference in Field "Months__c" and Days difference in the field "Days__c" where both are Formula Fields..
For Example:
Start_Date__c = 01/04/2017
End_Date__c = 01/05/2017
Hence, the Month Difference should be 1 Month & Days Difference should be 1Day.
Please Let me know if any one of you have encountered this before or have any appropriate solution for this.
Thanks
I have a requirement where we need to find the difference between 2 different Date fields.
1. Start_Date__c.
2. End_Date__c.
We want to Store the Month difference in Field "Months__c" and Days difference in the field "Days__c" where both are Formula Fields..
For Example:
Start_Date__c = 01/04/2017
End_Date__c = 01/05/2017
Hence, the Month Difference should be 1 Month & Days Difference should be 1Day.
Please Let me know if any one of you have encountered this before or have any appropriate solution for this.
Thanks
Hi Sagar,
Please Use this formula's for your requirement
For Month__c
IF( Month(End_Date__c) - Month(Start_Date__c) > 1, TEXT(FLOOR(Month(End_Date__c) - Month(Start_Date__c))) & " Month ", "1 Month")
For day__c
IF( End_Date__c - Start_Date__c > 0, TEXT(FLOOR(End_Date__c - Start_Date__c)) & " day ", "")
Ideally as per you example it should show 0 month and 1 day
If you want to use that condition, use below mentioned formula for month
For Month__c
IF( Month(End_Date__c) - Month(Start_Date__c) > 0, TEXT(FLOOR(Month(End_Date__c) - Month(Start_Date__c))) & " Month ", "")
let me know if it helps
Thanks