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
Priyadarshi NayakPriyadarshi Nayak 

Error in formula -

While trying below FORMULA TRAILHEAD (https://developer.salesforce.com/trailhead/point_click_business_logic/formula_fields), getting error while saving FORMULA. Any help

Formula Object - CASE
FORMULA Return- number of days between the account’s Last Activity Date and today
Formula Code- 
Account.LastModifiedDate  -    TODAY()
Error -  Error: Incorrect parameter type for operator '-'. Expected Number, DateTime, received Date

If I change TODAY() to NOW() the compilation error gets resolved but challenge evaluation fails with following errors

Challenge not yet complete... here's what's wrong: 
The 'Days_Since_Last_Update__c' formula field did not return the correct number of days between an Account’s Last Activity Date and today

Thanks
Priya
Best Answer chosen by Priyadarshi Nayak
Jithin Krishnan 2Jithin Krishnan 2
Hi Priya,
Try the below formula:
Today()- Account.LastActivityDate
Please let me know if this helped you.
Thanks!
 

All Answers

Jithin Krishnan 2Jithin Krishnan 2
Hi Priya,
Try the below formula:
Today()- Account.LastActivityDate
Please let me know if this helped you.
Thanks!
 
This was selected as the best answer
Priyadarshi NayakPriyadarshi Nayak
Thanks Jithin .....it works.....