Customer Engagement & Dynamics CRM Forum

Expand all | Collapse all

calculating days and nights with two date fields

  • 1.  calculating days and nights with two date fields

    TOP CONTRIBUTOR
    Posted Jul 01, 2020 01:48 PM
    I'm trying to determine total Days and total nights (day - 1) on a calculated field I called total days. I dont know how to get this to work, getting errors.

    I have two fields I created called Date departure and date return. both are set for date only. When I try to calculate I am not sure what to use?

    I tried to find a blog online but I dont think I'm doing it right. Do I want DiffinDays? Or need something else?
    I also then need to subtract 1 day to get the total nights.



    ------------------------------
    Heather L
    ------------------------------
    The first step toward cloud success. - Migrate from CRM to D365 with expert guidance from Microsoft. I'm Ready


  • 2.  RE: calculating days and nights with two date fields

    Posted Jul 02, 2020 04:47 AM
    Hi,
    Diffindays is a function, if i remember right you have to pass 2 parameters, so something like that:
    DiffinDays(Enddate, Startdate).
    There is an example on this Doc site: https://docs.microsoft.com/en-us/dynamics365/customerengagement/on-premises/customize/define-calculated-fields
    And all functions are explainded.
    Regards,
    Marc

    ------------------------------
    Marc Lübberstedt
    SYCOR GmbH
    Göttingen
    ------------------------------

    The first step toward cloud success. - Migrate from CRM to D365 with expert guidance from Microsoft. I'm Ready


  • 3.  RE: calculating days and nights with two date fields

    TOP CONTRIBUTOR
    Posted Jul 02, 2020 08:56 AM
    thank you I will check it out!

    ------------------------------
    Heather L
    ------------------------------

    The first step toward cloud success. - Migrate from CRM to D365 with expert guidance from Microsoft. I'm Ready


If you've found this thread useful, dive deeper into User Group community content by role