Soql 查询检索两个日期之间的机会

发布于 2024-11-19 14:23:24 字数 389 浏览 7 评论 0原文

我正在尝试检索 2011 年 1 月 1 日至 2011 年 6 月 30 日之间创建的机会。

Select o.CreatedDate, o.Id, o.LastModifiedDate
from Opportunity o 
where   o.CreatedDate > '1/1/2011' and o.CreatedDate <  '12/31/2011'
order by  o.LastModifiedDate

由于 createate 是日期时间,我收到一条错误消息,指出createdDate 是日期时间,不应用引号引起来。

有人可以帮助了解如何使此查询正常工作吗?我只是想让这个查询让它在 apex 资源管理器中运行,这不是 apex 代码的一部分

I am trying to retrieve opportunities created between 01-01-2011 and 06-30-2011.

Select o.CreatedDate, o.Id, o.LastModifiedDate
from Opportunity o 
where   o.CreatedDate > '1/1/2011' and o.CreatedDate <  '12/31/2011'
order by  o.LastModifiedDate

since createdate is a datetime i get a error saying createdDate is datetime and should not be enclosed in quotes.

Can someone help on how to get this query working. I just want this query to get it running in apex explorer, this is not part of apex code

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

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

发布评论

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

评论(1

记忆之渊 2024-11-26 14:23:24

用于检索两个日期之间机会的 SOQL 查询:

Select o.CreatedDate, o.Id, o.LastModifiedDate 
from Opportunity o 
where   o.CreatedDate > 2011-01-01T00:00:00Z and o.CreatedDate < 2011-12-31T00:00:00Z 

SOQL query to retrieve opportunities between two dates:

Select o.CreatedDate, o.Id, o.LastModifiedDate 
from Opportunity o 
where   o.CreatedDate > 2011-01-01T00:00:00Z and o.CreatedDate < 2011-12-31T00:00:00Z 
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文