Dynamics ax 2012中两个日期之间的月数

时间:2018-02-19 11:43:02

标签: axapta dynamics-ax-2012

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

1 个答案:

答案 0 :(得分:4)

最近我遇到了需要计算两个日期之间的月数的情况,我在动态ax 2012中找到了一个可以使用的内置方法。

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.

请从以下网站参考上述方法的例子: https://community.dynamics.com/ax/b/alirazatechblog/archive/2013/06/11/dynamics-ax-2012-number-of-months-between-two-dates

还有另一种方法可以使用方法InfAdjValidation_MX :: monthDifference(FromDate _fromDate,ToDate _toDate)计算Dynamics ax 2012中以月为单位的两个日期之间的差异