+ Start a Discussion
peteppetep 

Calculate days from CreatedDate to Today

Hi,

 

What's the formula to calculate the difference of the days?

 

Thanks.

Best Answer chosen by Admin (Salesforce Developers) 
SwarnasankhaSwarnasankha

The Today() function returns a Date value whereas the CreatedDate returns a Date/Time value. So what is required is for you to convert the Date/Time value into a Date value and perform a simple subtraction between the two values.

 

Try this : TODAY() - DATEVALUE(CreatedDate)

 

Hope this helps you.

All Answers

SwarnasankhaSwarnasankha

The Today() function returns a Date value whereas the CreatedDate returns a Date/Time value. So what is required is for you to convert the Date/Time value into a Date value and perform a simple subtraction between the two values.

 

Try this : TODAY() - DATEVALUE(CreatedDate)

 

Hope this helps you.

This was selected as the best answer
peteppetep

Thanks!