1

I am doing first time in validation rule. I need this scenario Date field must be today or up to 367 days in the future. Could you please suggest the formula for the same.

I did this way but it is working only today and greater than 367 days but i need only up to 367 days in future

AND(OR(ISNEW(),ISCHANGED(Date__c)),Date__c< TODAY()) 
0

1 Answer 1

2

You're simply missing the part that sets a maximum value. You need to use an OR for the ranges as well, since it can be either before or after the range of today to 367 days from now, but never both.

AND(
    OR(ISNEW(), ISCHANGED(Date__c))
    OR(Date__c < TODAY(), Date__c > TODAY() + 367)
)
2
  • Hi Adrian, Thank you for your help...Now working fine
    – Mahitha
    Commented Sep 29, 2016 at 13:52
  • @Mahitha Glad to hear it! If this answer addressed your problem, please consider accepting it by clicking on the check mark/tick to the left of the answer, turning it green. This marks the question as resolved to your satisfaction, and awards reputation both to you and the person who answered. If you have >= 15 reputation points, you may also upvote the answer if you wish. There is no obligation to do either.
    – Adrian Larson
    Commented Sep 29, 2016 at 13:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .