FetchXML 大于

发布于 2024-12-07 07:21:29 字数 1120 浏览 0 评论 0原文

我正在使用 FetxhXML,并且我希望条件大于一定的小时数。

这就是我所拥有的:

string groupby1 = "<fetch distinct='false' mapping='logical' aggregate='true'>" +
    "<entity name='opportunity'>" +
        "<attribute name='opportunityid' alias='opportunity_count' aggregate='countcolumn' />" +
        "<filter type='and'>" +
          "<condition attribute='new_leadstatus' operator='eq' value='100000000' />" +
          "<condition attribute='new_emailedtorsm' operator='eq' value='false' />" +
          "<condition attribute='ownerid' operator='not-null' />" +
          "<condition attribute='createdon' operator='last-x-hours' value='1' />" +
        "</filter>" +
        "<attribute name='ownerid' alias='ownerid' groupby='true' />" +
        "<link-entity name='systemuser' from='systemuserid' to='ownerid'>" +
            "<attribute name='internalemailaddress' alias='internalemailaddress' groupby='true' />" +
        "</link-entity>" +
    "</entity>" +
"</fetch>";

所以基本上在创建条件下我希望它大于 1 小时或大于最后 x 小时。这可能吗?

I am using FetxhXML and I want the condition to be greater than a certain number of hours.

This is what I have:

string groupby1 = "<fetch distinct='false' mapping='logical' aggregate='true'>" +
    "<entity name='opportunity'>" +
        "<attribute name='opportunityid' alias='opportunity_count' aggregate='countcolumn' />" +
        "<filter type='and'>" +
          "<condition attribute='new_leadstatus' operator='eq' value='100000000' />" +
          "<condition attribute='new_emailedtorsm' operator='eq' value='false' />" +
          "<condition attribute='ownerid' operator='not-null' />" +
          "<condition attribute='createdon' operator='last-x-hours' value='1' />" +
        "</filter>" +
        "<attribute name='ownerid' alias='ownerid' groupby='true' />" +
        "<link-entity name='systemuser' from='systemuserid' to='ownerid'>" +
            "<attribute name='internalemailaddress' alias='internalemailaddress' groupby='true' />" +
        "</link-entity>" +
    "</entity>" +
"</fetch>";

So basically on the createdon condition I would want it to be greater than 1 hour or greater than the last x hours. Is this possible?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

看春风乍起 2024-12-14 07:21:29

您需要使用 on-or-before 条件并插入当前时间前一小时的您自己的 DateTime,如下所示:

string groupby1 = string.Format(@"
//snip...
<condition attribute='createdon' operator='on-or-before' value='{0}' />
//snip...
", DateTime.Now.AddHours(-1).ToUniversalTime().ToString("u"));

You'll need to use the on-or-before condition and insert your own DateTime that is one hour before the current time, like so:

string groupby1 = string.Format(@"
//snip...
<condition attribute='createdon' operator='on-or-before' value='{0}' />
//snip...
", DateTime.Now.AddHours(-1).ToUniversalTime().ToString("u"));
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文