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
rahworksrahworks 

Advanced Formula Help - Number of Days between dates

In opportunites, I am creating a Custom field
Choosing "Formula" for field type
Choosing return a "Number" for the value
Selecting Advance Formula
Trying to accomplish this.....
How long since the Opportunity was opened until the time it was closed Won, or closed Lost
My brain tells me to do
ClosedDate - CreateDate = Number of Days
 
It's not working no matter what I have tried.  Please help asap
Best Answer chosen by Admin (Salesforce Developers) 
BuellBuell
Try this:


Code:
CloseDate - DATEVALUE( CreatedDate )

Looks like all your other settings are spot on.

All Answers

BuellBuell
Try this:


Code:
CloseDate - DATEVALUE( CreatedDate )

Looks like all your other settings are spot on.

This was selected as the best answer
BuellBuell
Just so you know what is going on, the 'CreatedDate' field is a date and time, so it needs to be converted back to a date with the formula DATEVALUE( CreatedDate ).
rahworksrahworks
That was exactly what the problem was. 
 It is now working, and I cannot thank you enough.