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)

Convert value integer to DateFormula

(0) ShareShare
ReportReport
Posted on by 273

Imagine this scenario,

I've calculated the average number of days that a Purchase Order takes to get in the wharehouse. Basically the difference between the Posting Date and the Order Date . The result was a value integer.

My goal is to fill in the table Item , the field Safety Lead Time that is a date formula, but it need a preefix such as D or it gives me back error.
How can i converto the integer to days?

This is what i've tried

...

MediaDias:=ROUND((DiasTotal/ContadorDocs),1,'>');
EVALUATE(DataP,FORMAT(MEdiaDias));

Item."Safety Lead Time Calculado":=DataP;
Item.MODIFY;

Where DataP is also datatype Dateformula.

Thanks for the help

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Hannes Holst Profile Picture
    5,767 on at
    MediaDias:=ROUND((DiasTotal/ContadorDocs),1,'>');
    EVALUATE(DataP,'<'+FORMAT(MEdiaDias)+'D>');

    There are probably better solutions somewhere :-)

  • Suggested answer
    Rikarddo Profile Picture
    273 on at

    Got it..

    EVALUATE(Item."Safety Lead Time Calculado", FORMAT(MEdiaDias) + 'D');

    Item.MODIFY;

    Thanks anyway!

  • Suggested answer
    Rikarddo Profile Picture
    273 on at

    Thanks! It was a big help!

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