Notifications
Announcements
No record found.
Hi
Dynamics AX4
Can someone give a script to calculate the working days between two date fields in a report and output to a field.
Thanks
*This post is locked for comments
Hi Bapservice,
You can calculate the number of days using the next coding.
NumOfDays (integer) = Date1 - Date2;
If you are looking for the interval in number of days, then you could use this
days = date2num(column1) - date2num(column2);
Hope it helps.!
Have a look at this:
daxture.blogspot.co.ke/.../businessworking-days-in-ax.html
dotnetxperience.blogspot.co.ke/.../ax-2012-x-add-n-working-days-to-date.html
Thanks Guys
My knowledge of X++ is limited.
At this stage i am trying to establish the working days between the ProdTable,createdDate and the ProdTable,DlvDate and out put as a field in a report
I presume a method script is required.
Have a look at this link:
dynamicsuser.net/.../49484.aspx
Hi Robert
Can you assist?
What mods do i require to this script to use the
ProdTable,createdDate and the ProdTable,DlvDate and out put as a field in a report
You could use this.
ProdTable ProdTable;
int days;
;
days = date2num(ProdTable.createdDate) - date2num(ProdTable.DlvDate);
Please check if this helps.!
When I use this method and output to a report field (integer:LeadTime) I get the result 0
Can someone assist please.
display LeadTime LeadTime()
{
days = date2num(ProdTable.DlvDate) - date2num(ProdTable.createdDate);
Return days;
}
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 4 Most Valuable Professional
Priya_K 4
MyDynamicsNAV 2