You need to sign in to do that
Don't have an account?
Delzner5
New to date formulas- Subtracting 2 custom field
I am trying to do a simple subtraction formula for calculating a duration date using
Project_End_Date__c - Project_Start_Date__c
I get the following error:
Error: Formula result is data type (Number), incompatible with expected data type (Date).
What am I doing wrong?
Delzner, It works If you set the return type of formula to Number. The output will be the no.of days between two dates.
All Answers
What is the datatype of your formula field? If you add or subtract a Date value from another Date value your result is gonna be a number (the number of days). If you add or subtract a number value from another Date value your result is gonna be a Date (Date +/- the number of days).
Date - Date = Number
Date - Number = Date
You need to create a NEW custom field and specify Formula as the datatype and Number as the result. Then put your Date1 -Date2 formula in there
Delzner, It works If you set the return type of formula to Number. The output will be the no.of days between two dates.
Your formula retun type should be nubmer as the difference between two dates will give you a Integer Number.
thank you all