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 NAV (Archived)

How to convert '2 days 39 minutes 33 seconds 957 milliseconds' in HH:MM format??

(0) ShareShare
ReportReport
Posted on by

Hi All,

I want to calculating value in (Duration = datetime - datetime) this format. W.r.t this formula i am able to get answer in '2 days 39 minutes 33 seconds 957 milliseconds' format but i want same in hh:mm format.

I followed below steps

Name               DataType    Subtype    Length
ProcessStart     DateTime        
ProcessEnd      DateTime
TimeDuration  BigInteger
TotalHours       Integer         

ProcessStart := CREATEDATETIME(010109D,072005T);
ProcessEnd := CREATEDATETIME(300109D,103000T);
TimeDuration := ProcessEnd - ProcessStart;
TotalHours := TimeDuration/3600;
Message('%1',TotalHours);

but facing attached error

Microsoft Dynamics NAV
---------------------------

Overflow under conversion of Microsoft.Dynamics.Nav.Runtime.Decimal18 value 48659.4325 to System.Int32.
---------------------------
OK
---------------------------

any other solution for doing same???

Thanks in advance!!

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Suresh Kulla Profile Picture
    50,243 Super User 2025 Season 2 on at

    Madhuri,

    To fix the above issue change your Totalhours DataType to Decimal instead of Integer.

  • Suggested answer
    ShanAbeywicrema Profile Picture
    948 on at

    I would agree with Suresh. You need to change the data type for TotalHours. It should be decimal data type. 

    If you need you can refer https://msdn.microsoft.com/en-us/library/dd338759.aspx for more details about Data types in Dynamics NAV.

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 NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans