You need to sign in to do that
Don't have an account?
prady
Soql query to retrieve opp between two dates
Hi,
I am trying to retrive opps 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
Thanks
Prady
Try this :
Thanks
Ankit Arora
Blog | Facebook | Blog Page
All Answers
Try this :
Thanks
Ankit Arora
Blog | Facebook | Blog Page
Thanks Ankit. I kinda figured it out myself
I was looking to run it on the apex explorer rather than on the apex code(which i didnt mention in my question)
Thanks Ankit.
Prady,
Your code works fine when field type is 'datetime'. What if the datatype is 'date' ? I am stuck at it in apex explorer.
you remove the time value, just have the date if you are using a date field
it should work..
Thanks Prady. Great help.
Please help