You need to sign in to do that
Don't have an account?

Formula to net the greater of two dates (Last Modified and Last Activity)
I want to create a field to reflect the last time an Opportunity was changed (by modificication or an activity). I wrote the following formula and used a return type of date:
IF( LastModifiedDate > LastActivityDate, LastModifiedDate, LastActivityDate )
But I am getting this error message and I can't figure out how to work around it. Any help would be much appreciated.
Error: Incorrect parameter for function >(). Expected DateTime, received Date
You're comparing 2 different Datatypes in your fomula, that's what you're getting the error.
LastModified is Date/Time field
LastActivity is a Date field
you need to use the
IF(DATEVALUE(LastModifiedDate) > LastActivityDate,
DATEVALUE(LastModifiedDate),
LastActivityDate )
So you probably want a formula that looks like
All Answers
You're mis-matching two fields.
I believe Last modified is by default a date/time while the the other may be date. Either that or the field you're trying to indicate the changes on is defined as date and you're trying to write a date/time.
You're comparing 2 different Datatypes in your fomula, that's what you're getting the error.
LastModified is Date/Time field
LastActivity is a Date field
you need to use the
IF(DATEVALUE(LastModifiedDate) > LastActivityDate,
DATEVALUE(LastModifiedDate),
LastActivityDate )
So you probably want a formula that looks like
Steve helped me with this formula for a custom field a few weeks ago but I found a small problem with it and I'm hoping he or someone else can help. Basically it is only returning a value if both a "Last Activity" and "Last Modified Date" exist. If no activity exists then it is just blank. Here is the formula again:
IF(DATEVALUE(LastModifiedDate) > LastActivityDate, DATEVALUE(LastModifiedDate), LastActivityDate )
Any help you can provide would much, much appreciated.
Thanks
What value do you want the Formula to return if the Last Activity = NULL?
An IF statement has to have an Else result.
Okay, try flipping the formula around like this (Last Modified Date is never blank):
IF(LastActivityDate > DATEVALUE(LastModifiedDate),
LastActivityDate,
DATEVALUE(LastModifiedDate))