« Salesforce Adds "Social Intelligence" for Chatter | Main | Cloudingo Promo Code »

SOQL: Retrieve Opportunities Between Two Dates

The query below will help you retrieve opportunities created between two dates. Please note that in the below query, the field type is “DateTime”; if you want to use the code for the “Date” field, just remove the time value.

Select createdDate, Id, lastModifiedDate

from Opportunity

where createdDate > 2013-03-26T24:00:00Z and createdDate < 2013-04-01T23:00:00Z


More tips coming soon!

PrintView Printer Friendly Version

EmailEmail Article to Friend

Reader Comments (1)

Great post, i have a question can i use same query to retrieve between AccountIds in SOQL

October 3, 2013 | Unregistered CommenterRob

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
All HTML will be escaped. Hyperlinks will be created for URLs automatically.
Errors occurred while processing template[pageRendered/]:
StringTemplate Error: Can't parse chunk: {settingHomePageKBArticle}" target="_blank">Learn how.</a></li>
<li>If you have already selected a front page, make sure it is enabled. Click on the Cubes icon (top right) and then click the "enable page" button.</li>

: expecting '"', found '<EOF>'
StringTemplate Error: problem parsing template 'pageRendered/noDefaultModule': null
StringTemplate Error: problem parsing template 'pageRendered/noDefaultModule': null