在Acumatica中,DateAdd函数的等价性是什么?我看到有一个DateDiff,但没有DateAdd。
我正在尝试执行以下- SQL:(DateAdd(DAY,(180 * RemainingQty / TotalQty),GetDate()
PXDBCalced(类型(添加,totalQty>,AccessInfo.businessDate>),类型(DateTime))
我收到一个错误消息:“指定的强制转换无效。”
有人能给我提供如何达到我想要达到的目标的指导吗?谢谢。
发布于 2017-05-18 09:24:35
您可以使用BQL类添加天数。
如果day是PXFormula DAC字段,则可以计算如下值:
[PXDBCalced(typeof(Add<Current<AccessInfo.businessDate>, NullableIntDACField>), typeof(DateTime))]
您还可以使用常量:
public class int180 : Constant<int>
{
public int180()
: base((int)180)
{
}
}
[PXDBCalced(typeof(Add<Current<AccessInfo.businessDate>, int180>), typeof(DateTime))]
将这两种技术结合到您的具体公式中将是:
[PXDBCalced(typeof(Add<Current<AccessInfo.businessDate>, Div<Mult<int180, remainingQty>, totalQty>>), typeof(DateTime))]
发布于 2018-02-23 11:37:52
现在可以用了。(引用http://erpsoftwareblog.com/cloud/2015/08/with-acumatica-you-can-gather-data-by-specified-date/ )
=DateAdd(today(),’d’, 9)
以下是一些样本:
DateAdd($DueDate, 'm', -2)
DateAdd(CDate('31/01/1995'), 'm', -2)
DateAdd($DueDate,'y', -2)
DateAdd(Cdate($DueDate), 'd', -2)
https://stackoverflow.com/questions/44053392
复制