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
Anusha Bansal 9Anusha Bansal 9 

Urgent: Add two date fields in FORMULAS

Hi,

I need to add two date fields in FORMULAS and get the result in number.
(Progress Date + Approved Date )

Progress Date: Type as Date
Approved Date : Type as Date

Getting below error: 
Error: Incorrect parameter type for operator '+'. Expected Number, received Date

Please suggest
David HalesDavid Hales
Hi Anusha, 

Date's cannot be added directly. However, i would suggest you view this 
https://help.salesforce.com/articleView?id=formula_examples_dates.htm&type=0 
how and what operation you can perform on Dates. 

Please mark this as best answer if your Query is resolved. 
Best Regards 
David Hales(1058)
 
Arpit Gupta 37Arpit Gupta 37
TEXT(
 FLOOR(Progress Date +  Approved Date)
)
This will return Number of days.

TEXT(
ROUND(MOD((Progress Date + Approved Date)*24,24),0)
       )
 This will return Number of hours. 

TEXT(
ROUND(MOD((Progress Date  +  Approved Date)*1440,60),0)

This will return number of minutes.

Kindly mark it as the best answer if it works.