web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Calculated Field - DIFFINDAYS error

(0) ShareShare
ReportReport
Posted on by 71

Hi

I'm trying to use the standard calculated field to calculate the number of days between an Opportunity Created On and Actual Close Date

DIFFINDAYS(createdon, actualclosedate)

When I try to save the calculation it says:  "You can't use actualclosedate, which is of type dateTime, with the current function."

What is the problem here can anyone advise what is going wrong?

4478.error.PNG

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Joe Griffin Profile Picture
    1,254 on at

    Hi Robin,

    I tried replicating this on my side and I am getting the same issue - this is pure speculation, but the date format settings between both these fields are different, so just wondering if this could be causing the problem. As there is no way to override this behaviour, you could look at setting up a new date/time field, with the same format settings as the createdon field and then create a Flow/Business Rule to update this value every time the actualclosedate changes. This new field can then be used as part of your calculated field. You might also be able to escalate to Microsoft support for further guidance/assistance.

    Hope this helps!

    Thanks

    Joe

  • Verified answer
    LuHao Profile Picture
    40,892 on at

    Hi Robin,

    That because the system createdon field Behavior is set to User Local,

    3808.png

    and your actualclosedate is set to Date Only.

    However, once Behavior of a Date and Time field was set to Date Only, it can't be changed again:

    https://docs.microsoft.com/en-us/dynamics365/customer-engagement/portals/behavior-format-date-time-field

    To overcome this issue, you could create a on-demand workflow and a new date and time field with same Behavior as createdon, update this new field with previous actualclosedate:

    1616.png

    Then bulk updating the new custom fields:

    3617.png

    Finally you work with new field to calculate.

    1050.png

    Regards,

    Clofly

  • RobinA Profile Picture
    71 on at

    Great that resolved the issue Clofly thank you very much for your time.

     

  • LuHao Profile Picture
    40,892 on at

    Hi Robin,

    I'm glad your problem has been solved.

    Please click Yes to mark the verified answer.

    8270.png

    This will help other users quickly navigate to this theme.

    Thanks.  :)

  • Carlik Profile Picture
    55 on at

    Starting from your reply I think I have a simpler solution.

    I created a date/time field on opportunity (__fixedCreatedOn), set it as DateOnly and set it as calculated field. It is setted as equal to createdon field. (so I don't create any workflow)

  • Eric benco Profile Picture
    320 on at

    At some point in time,  Microsoft changed the behavior of the Actual Start Date field.   So @carlik suggestion will only work if you have an older version of D365. 
    pastedimage1611174980939v1.png

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Wayne Walton Profile Picture

Wayne Walton 2

#2
Good.Panos Profile Picture

Good.Panos 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans