简体   繁体   中英

Number of months between two dates in Dynamics ax 2012

是否有标准/通用方法/公式来计算Microsoft Dynamic Axe 2012中两个日期之间的月数?

Recently I got a situation where I need to calculate the number of months between 2 dates, I found a built-in method in dynamics ax 2012 that can be used.

noOfIntervals = intvNo(refDate, inputDate, intvScale::Month);

intvScale enumation have two values for months   

◾Month  
◾YearMonth  

If we provide the intvScale::Month then X++ ignores the year and assumes 
that month is calculated within one year.

If we provide the intvScale::YearMonth then X++ calculate the number of 
months between different years. Consider following example.

please refer example of above method from below website: https://community.dynamics.com/ax/b/alirazatechblog/archive/2013/06/11/dynamics-ax-2012-number-of-months-between-two-dates

There is another way to Calculates the difference between two dates in month units in Dynamics ax 2012 using method InfAdjValidation_MX::monthDifference(FromDate _fromDate, ToDate _toDate)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM