function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SapamrmSapamrm 

Expression help: CreatedDate > specific date/time

I'm trying to create a validation rule that only has to work when the date of creation is greater than a specific date (e.g. 21/12/2010).

 

With date fields I know I have to use the expression: Custom date field > DATE (2010,10,21)

 

But CreatedDate is a date/time field. How should I adapt the expression below in order to make it work?

 

 

AND
(
(ISPICKVAL( Reason_Won_lost__c ,'')),
CreatedDate > xxx),
OR
(
(ISPICKVAL( Actual_Stage__c ,'Closed lost')),
(ISPICKVAL( Actual_Stage__c ,'Closed won'))
)
)

 

 

Thanks in advance!

Best Answer chosen by Admin (Salesforce Developers) 
CLKCLK

DATEVALUE(Created date) > DATE (2010,10,21)

or

DATEVALUE(Created date) > DATEVALUE('21/12/2010')

try this.

All Answers

CLKCLK

DATEVALUE(Created date) > DATE (2010,10,21)

or

DATEVALUE(Created date) > DATEVALUE('21/12/2010')

try this.

This was selected as the best answer
SapamrmSapamrm

The first one worked!

 

Thanks a lot!!