Skip to main content

Notifications

Microsoft Dynamics NAV (Archived)

Calculating the difference between two DateTimes

(0) ShareShare
ReportReport
Posted on by 162

Hi,

I want to see if the Earliest Start / Date Time of a Job queue is older than 1 day ago. How do I do this?

For example  

Todayy := CALCDATE('<CD-1D>',TODAY);

Time := Time;
 
    "Earliest Start Date/Time" := CREATEDATETIME(Todayy,Time);
    IntDifference := CURRENTDATETIME - "Earliest Start Date/Time";
    IF IntDifference > 1 THEN

This example returns a high value integer not what I am expecting. 

*This post is locked for comments

  • ManishS Profile Picture
    ManishS 6,578 on at
    RE: Calculating the difference between two DateTimes

    But why do you want to check job queue days, any specific reason.

  • Suggested answer
    Suresh Kulla Profile Picture
    Suresh Kulla 43,745 on at
    RE: Calculating the difference between two DateTimes

    Check this link, you need to calculate duration and convert it into hours and minutes

    dynamicsuser.net/.../datetime-duration

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

News and Announcements

Announcing Category Subscriptions!

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,370 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans