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
wkaikwkaik 

Subtract two dates from each other?

Hi Everyone,

 

I am trying to create a formula to take a future date and substract it from the current date. When stracting dates it say it expects a number as the second value. Does anyone have any ideas.

 

Thanks,

BK

fifedogfifedog

What are the dates you're using. You have to be careful if your mixing date/time field with date fields. Since your formula is of type "number" it's expecting numbers as the values, but since you're using dates that's the issue.

 

However use date to number function datevalue.  Here is an example of a formula type number where I use two dates.

 

 

datevalue(Solution_Provided__c) - datevalue(CreatedDate)