web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans