1

Hi guys I just want to get total no of days spent in between the dates,project_completion_date__c is date field and converted to datetimevalue as created date is DATETIME datatype. Here is my formula it's throwing following error

Incorrect argument type for function 'ISNULL()'

Any one have an idea about this error?

IF(ISNULL(Project_Completion_Date__c), 
   (Now() - CreatedDate),
IF(NOT(ISNULL(Project_Completion_Date__c <> NULL)),(DATETIMEVALUE(Project_Completion_Date__c) - CreatedDate), 
1) 
)
1

There are several problems in your formula.

First, you use the ISNULL function with a boolean inside Project_Completion_Date__c <> NULL instead of only the Project_Completion_Date__c field.

Then, you don't need to check if the field is not null, you're already in a IF function.

So here's the right formula:

IF(ISNULL(Project_Completion_Date__c), 
   Now() - CreatedDate,
   DATETIMEVALUE(Project_Completion_Date__c) - CreatedDate,
)
  • 1
    How foolish am I?. Thanks for your review Martin. – Laxman Jun 27 '17 at 9:44
  • @Laxman Alternatively: BLANKVALUE(DATETIMEVALUE(Project_Completion_Date__c), NOW()) - CreatedDate – sfdcfox Jun 27 '17 at 12:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for?Browse other questions tagged or ask your own question.