I have this formula:
NOW() - Lead_Escalation_from_Production__c
And this is what the Lead_Escalation_from_Production__c
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?
NOW() - Lead_Escalation_from_Production__c
has return typeDate/Time
but it is actually returning the difference in number of days. So, you might have to change the return type toNumber
if that is what you're expecting.