Skip to main content

Notifications

Small and medium business | Business Central, N...
Suggested answer

how to find calculate the number of days between two dates business central

Posted on by 44

How to find calculate the number of days between two dates business central.

Example:
Order- 03/02/23
Due - 05/02/23
Result: 2 
  • Deekshitha Reddy Profile Picture
    Deekshitha Reddy 219 on at
    RE: how to find calculate the number of days between two dates business central

    NoOfDays:=Abs(Order-Due);

    Here NOfDays is a variable(Integer),Abs(Absolute) returns positive numeric value.

    learn.microsoft.com/.../system-abs-method

    Hope this Helps

  • Thiran Profile Picture
    Thiran 44 on at
    RE: how to find calculate the number of days between two dates business central

    Thank you

  • Suggested answer
    Mohana Yadav Profile Picture
    Mohana Yadav 59,127 Super User 2024 Season 2 on at
    RE: how to find calculate the number of days between two dates business central

    Looks like your date format is MM/DD/YYYY

    Change it to

    Order- 02/04/23, Due - 02/05/23 and try

  • Suggested answer
    Shrey Chauhan Profile Picture
    Shrey Chauhan 288 on at
    RE: how to find calculate the number of days between two dates business central

    try due - order

  • Suggested answer
    Shrey Chauhan Profile Picture
    Shrey Chauhan 288 on at
    RE: how to find calculate the number of days between two dates business central

    NoOfDays:=ABS(Due - Order);

    Try this One

  • Thiran Profile Picture
    Thiran 44 on at
    RE: how to find calculate the number of days between two dates business central

    Result := Order - Due; Isn't working.

  • Thiran Profile Picture
    Thiran 44 on at
    RE: how to find calculate the number of days between two dates business central

    Isn't working.

    Order- 04/02/23, Due - 05/02/23, Result Count - 30 <- its wrong, We have count 1

  • Suggested answer
    Shrey Chauhan Profile Picture
    Shrey Chauhan 288 on at
    RE: how to find calculate the number of days between two dates business central

    You can use CalcDate function to calculate Dates

    Or else

    Result := Order - Due;

    Result field must be integer

    Thank you

  • Suggested answer
    Mohana Yadav Profile Picture
    Mohana Yadav 59,127 Super User 2024 Season 2 on at
    RE: how to find calculate the number of days between two dates business central

    Isn't NoOfDays := Due - Order; work?

    NoOfDays is integer datatype

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

New! Quick response templatesâš¡

Save time with the new custom templates!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,219 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,056 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans