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
Taylor FrissTaylor Friss 

Formula field should return 0, but it is returning -1.

Hi! I've created a formula field to count how long a lead has been under the current owners name. 

Note: The formula I've created includes Salesforces default field "LastTransferDate"

Here is the formula:

Today() - LastTransferDate

When looking at a lead record to make sure it worked properly, I noticed it is not calculating properly. 

The Last Transfer Date is set as 10/17/2019 which is TODAY'S date and for some reason it is returning -1 instead of 0. Any thoughts?
Taylor FrissTaylor Friss
I noticed that if I allow for 2 decimal points the formula is returning -0.53. This must mean that LastTransferDate is secretly a Date Time value, even though it is not displayed as such. That being said, when using DATEVALUE(LastTransferDate) I am getting an error of:

Error: Incorrect argument type for function 'DATEVALUE()'.

 
Nubes Elite Technologies Pvt. LtdNubes Elite Technologies Pvt. Ltd
Hi Taylor,

I request you to try this once.

If it's a Date Field then we do not have to write DATEVALUE, instead directly use LastTransferDate.

Thank You,
www.nubeselite.com
Development | Training | Consulting

Please mark this as solution if your problem is solved.