You need to sign in to do that
Don't have an account?
Anu Sharma 54
Hi, i have two field start date and end date I want to validation that is end date must be in between 2 to 6 month only How can i do that.
Hi,
i have two field start date and end date I want to validation that is end date must be in between 2 to 6 month only How can i do that.
i have two field start date and end date I want to validation that is end date must be in between 2 to 6 month only How can i do that.
First, create a formula field ( Months Between ) which returns number
IF(NOT(ISBLANK(End_Date__c)) && NOT(ISBLANK(Start_date__c))
,(((YEAR(End_Date__c ) - YEAR(Start_Date__c ) - 1) *12) + (12 - MONTH(Start_Date__c ) +1) + MONTH(End_Date__c ) - 1+ IF(DAY(End_Date__c ) > DAY(Start_Date__c ),1,0)))
, null
)
After that create the following validation rule
((Months_Between__c ) < 2) || ((Months_Between__c) > 6)
If the answer helps you, please mark it as best answer.
Thanks
Good luck
All Answers
First, create a formula field ( Months Between ) which returns number
IF(NOT(ISBLANK(End_Date__c)) && NOT(ISBLANK(Start_date__c))
,(((YEAR(End_Date__c ) - YEAR(Start_Date__c ) - 1) *12) + (12 - MONTH(Start_Date__c ) +1) + MONTH(End_Date__c ) - 1+ IF(DAY(End_Date__c ) > DAY(Start_Date__c ),1,0)))
, null
)
After that create the following validation rule
((Months_Between__c ) < 2) || ((Months_Between__c) > 6)
If the answer helps you, please mark it as best answer.
Thanks
Good luck
If the answer is what you need please mark my answer as best answer.
Help the community so we can help you.
Thank you