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
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()
{
ProdTable ProdTable;
int days;
;
days = date2num(ProdTable.DlvDate) - date2num(ProdTable.createdDate);
Return days;
}
You could use this.
ProdTable ProdTable;
int days;
;
days = date2num(ProdTable.createdDate) - date2num(ProdTable.DlvDate);
Please check if this helps.!
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
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.
Hi Bapservice,
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
If you are looking for the interval in number of days, then you could use this
days = date2num(column1) - date2num(column2);
Hope it helps.!
Hi Bapservice,
You can calculate the number of days using the next coding.
NumOfDays (integer) = Date1 - Date2;
Mohamed Amine Mahmoudi
100
Super User 2025 Season 1
Community Member
48
Zain Mehmood
6
Moderator