can someone explain why the formula below has no syntax error:
Days to Close (Number) = CloseDate - TODAY()

but the one below has a syntax error:
Days Since Last Update (Number) = LastModifiedDate - TODAY()

They are both subtracting date fields but I'm getting the following error from the second one:
Error: Incorrect parameter type for operator '-'. Expected Number, DateTime, received Date

Does't make any sense to me. Can someone make sense of this. Thanks

  • I hope you are talking about the closedate field on opportunity.CloseDate is a field of type "Date" whereas "LastModifiedDate" is a field of type "Date Time"."Today()" function returns value of type "Date".So the lastmodifieddate should be converted to date inorder to subtract it from today() as per the below answer help.salesforce.com/…
    – Preya
    Commented Feb 1, 2017 at 4:44

1 Answer 1


LastModifiedDate is a DateTime field


Use DATEVALUE(LastModifiedDate) - TODAY()


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .