+ Start a Discussion
Emma ShankEmma Shank 

Add a custom forumula field

Hello,
I'm working on the Adding Business Logic trailhead challenge
https://developer.salesforce.com/trailhead/project/suggestion_box/suggestion_box_4
When entering the advanced formula I copy and paste the formula directly from the challenge

IF(ISBLANK(Implemented_Date__c), TODAY() - DATEVALUE(CreatedDate), Implemented_Date__c - DATEVALUE(CreatedDate) )

and receive 

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

I'm very new to admin and have no clue why this isn't working. Any help is appreciated! 
DavidGantDavidGant
Emma,

Did you choose Number as the Formula Return Type screen (step 2 of creating the formula field)? I ask because I just walked through the module and pasted your value above and it worked properly. 

David
Emma ShankEmma Shank
David,

Number is selected as the Forumula Return Type. When I check the syntax it highlights the second DATEVALUE text and gives the error stated above. I'm wondering if I set something up incorrectly in previous steps?

Emma
DavidGantDavidGant
Emma,

Is Implemented_Date__c set up as a Date field or Date/Time field? It should be a Date field.

David
Emma ShankEmma Shank
That did it, thank you!!!