针灸中DateAdd函数的等价性 [英] DateAdd function equivalent in Acumatica

查看:12
本文介绍了针灸中DateAdd函数的等价性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Acumatica中DateAdd函数的等价物是什么? 我看到有DateDiff,但没有DateAdd。

我正在尝试做以下事情- SQL: (DateAdd(day,(180*RemainingQty/TotalQty),GetDate()

[PXDBCalced(typeof(Add,totalQty>,AccessInfo.Commercial Date>),typeof(DateTime))]

我收到错误消息"指定的强制转换无效.."

谁能就如何实现我正在努力实现的目标提供一些指导意见?谢谢。

推荐答案

您可以使用BQL Add类添加天数。

如果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))]

这篇关于针灸中DateAdd函数的等价性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆