+ Start a Discussion
bhanu_prakashbhanu_prakash 

end date less than start date and actual date need to be between

HI,

I have three fields   start__c, end__c and actual_date__c, Iam looking to write validation rule,
1. end date need to be less than start date
2. Start date can't be more than end date.
3. Actual date need to be between start date and end date.
Note: All are date fields and actual date is optional to save record
i have tried it. its not working
IF(
	ISBLANK(actual_date__c),			
			(
				And
				(
					(
					 start__c > actual_date__c
					),   
                    (
					  actual_date__c < End__c
					)
                )			
            )		
			,		
		   (
            And
            (
                (
                    start__c > End__c
                ),   
                (
                End__c < start__c
                )
            )
         )
)


 
Best Answer chosen by bhanu_prakash
Rohit saini 4Rohit saini 4
Hi Bhanu,

Below should work :
 
IF( 
ISBLANK(actual_date__c),
( 
start__c > End__c
)
,
( 
OR( 
start__c > End__c, 
start__c > actual_date__c, 
actual_date__c > End__c 
) 
) 
)
Please let me know for any issues. Thanks.
 

All Answers

Rohit saini 4Rohit saini 4
Hi Bhanu,

Below should work :
 
IF( 
ISBLANK(actual_date__c),
( 
start__c > End__c
)
,
( 
OR( 
start__c > End__c, 
start__c > actual_date__c, 
actual_date__c > End__c 
) 
) 
)
Please let me know for any issues. Thanks.
 
This was selected as the best answer
bhanu_prakashbhanu_prakash
Thanks Rohit its worked :)