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



我正在尝试检索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

因为createdate是一个日期时间,所以我得到一个错误,说createdDate是日期时间,不应该用引号括起来。

可以有人帮助如何得到这个查询工作。我只想让这个查询在apex资源管理器中运行,这不是apex代码的一部分

检索两个日期之间的机会的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 

最新更新