Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV forum
Suggested answer

Calculating the difference between two DateTimes

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. 

  • 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,640 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

Quick Links

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,558 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,647 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans