Hello I am new to salesforce, I have to put a validation rule on a custom field (Deposit Date), There are 2 conditions:
1-Deposit date not exceed the current date
2-Deposit date not before 26 of previous month

  • Hi @Atul, welcome to SFSE! Please take a moment to visit the help center, scroll through the tour, and read How to Ask.
    – SE_User
    May 23, 2017 at 4:30
  • For questions like these (you are just starting to learn a specific part of Salesforce), it's usually better to see if there is anything that can help you over on Trailhead. Trailhead is much better suited for teaching the basics, and there is a module on validation rules.
    – Derek F
    May 23, 2017 at 12:45

1 Answer 1


You can use the below formula, It should work : -

Deposit_date__c > TODAY(), 
Deposit_date__c <DATE(YEAR(TODAY()),MONTH(TODAY())-1,26) 
  • There a fair chance of today being a date on January where you need to check against '26-Dec-Previous year'. May 23, 2017 at 9:03
  • Its not working yet
    – Atul
    May 24, 2017 at 13:39
  • For what scenario it is not working?
    – Avijit Das
    May 24, 2017 at 18:42
  • when i submit next date to current date it not show any error
    – Atul
    May 25, 2017 at 4:22

You must log in to answer this question.

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