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
Michelle ArndtMichelle Arndt 

Error: Formula result is data type (Number), incompatible with expected data type (Date/Time)

I have this formula: NOW() - Lead_Escalation_from_Production__c
And this is what the Lead Escalation from Production field holds (our business hours): IF(MOD(DATEVALUE(CreatedDate) - DATE(1900,1,7),7) = 6, DATETIMEVALUE(TEXT(DATEVALUE(CreatedDate + 2)) & " 12:00:00"),
IF(MOD(DATEVALUE(CreatedDate) - DATE(1900,1,7),7) = 0, DATETIMEVALUE(TEXT(DATEVALUE(CreatedDate + 1)) & " 12:00:00"),
IF(MOD(DATEVALUE(CreatedDate) - DATE(1900,1,7),7) = 5 && CreatedDate > DATETIMEVALUE(TEXT(DATEVALUE(CreatedDate)) & " 22:00:00"), DATETIMEVALUE(TEXT(DATEVALUE(CreatedDate + 3)) & " 12:00:00"),
IF(CreatedDate > DATETIMEVALUE(TEXT(DATEVALUE(CreatedDate)) & " 22:00:00"), DATETIMEVALUE(TEXT(DATEVALUE(CreatedDate + 1)) & " 12:00:00"),
IF(CreatedDate < DATETIMEVALUE(TEXT(DATEVALUE(CreatedDate)) & " 12:00:00"), DATETIMEVALUE(TEXT(DATEVALUE(CreatedDate)) & " 12:00:00"),
CreatedDate)))))
I am using a workflow rule that if the lead status is not open or has been converted i want it to do the formula above,NOW() - Lead_Escalation_from_Production__c, but I get the error message:Error: Formula result is data type (Number), incompatible with expected data type (Date/Time)
I would like to use now since it will get a closer time
Any suggestions?
v varaprasadv varaprasad
Hi Michelle,

You need to change the return type of your formula to a Number instead of a Date/Time. The error is saying that the formula is expecting to return a Date/Time, but the formula is actually returning a Number...

For more Info please check below link.

https://success.salesforce.com/answers?id=90630000000glUUAAY



Thanks
V varaprasad
Michelle ArndtMichelle Arndt
I am trying to figure out a date/time value for the lead response time.  Any suggestions since this returns a number?