SOQL查询要整整一个月,除了上周

发布于 2025-01-23 03:41:39 字数 180 浏览 3 评论 0原文

我想查询一个月的记录,除了那个月的去年。 我的SOQL查询是这个

select id,name from opportunity where CreatedDate=THIS_MONTH And WEEK_IN_MONTH IN (1,2,3)

SOQL查询以获取整个月,除了上周。

I want to query for records of a month, except that month's last year.
my soql query is this

select id,name from opportunity where CreatedDate=THIS_MONTH And WEEK_IN_MONTH IN (1,2,3)

soql query to get the whole month, except its last week.

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

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

发布评论

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

评论(1

安稳善良 2025-01-30 03:41:39

您将其标记为Apex,所以您可以作弊吗?

Date today = System.today();
Integer cutoff = Date.daysInMonth(today.year(), today.month()) - 7;

System.debug([SELECT Id
    FROM Opportunity
    WHERE CreatedDate=THIS_MONTH AND DAY_IN_MONTH(CreatedDate) < :cutoff]);

Yoou tagged it apex so can you cheat?

Date today = System.today();
Integer cutoff = Date.daysInMonth(today.year(), today.month()) - 7;

System.debug([SELECT Id
    FROM Opportunity
    WHERE CreatedDate=THIS_MONTH AND DAY_IN_MONTH(CreatedDate) < :cutoff]);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文