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
Jeff SaboJeff Sabo 

Question on Formulas

I am having difficulty creating a formula to calculate the number of days since a case was last updated.

I understand I have to use Today () in the formula. I have tried Case. Last Modified Date and in the formula as well and keep getting the same error.

Error: Incorrect parameter type for operator '-'. Expected Number, Date, received DateTime

I cannot figure out what formula I need to use. Can someone please assist?
Ankit SehgalAnkit Sehgal
Hey there,

Do this and you should be good to go!

TODAY - DATEVALUE(LastModifiedDate)

Best of luck!
SandhyaSandhya (Salesforce Developers) 
Hi Jeff Sabo,

If you are working on the following trailhead module

"Create a formula field that determines the number of days between today and the last activity date for a case's account."

Please use below formula.

 TODAY() -  Account.LastActivityDate

Please accept my solution as Best Answer if my reply was helpful. It will make it available for other as the proper solution. If you felt I went above and beyond, you can give me kudos.
 
Thanks and Regards
Sandhya


 
Amit Chaudhary 8Amit Chaudhary 8
Please create one formula field with Number type on case object like below 
(Today()- Account.LastActivityDate)
Please refer below screen shot. I hope that will help you
User-added image

Let us know if this will help you

 
Vasani ParthVasani Parth
Below Code working fine for your question,
TODAY() - Account.LastActivityDate as a fomula field Days_Since_Last_Update__c on Case Object.
Please mark this as the best answer if this helps