You need to sign in to do that
Don't have an account?
DJP
Get Opportunities By DateTime
Hi
I need an APEX class to retrieve Opportunities based on passed CreatedDate field. Basically, I need APEX class which accepts dateTime as parameter and I can use it in where clause of my SQL - SELECT AccountId, ID, OwnerID, Name, Model__C FROM Opportunity WHERE CreatedDate>='XXXXXXXXXXXX'.
The createDate is stored in 2017-09-12T22:26:37.000Z format. I dont know what is 000Z in this field value.
Thanks
Dipa
I need an APEX class to retrieve Opportunities based on passed CreatedDate field. Basically, I need APEX class which accepts dateTime as parameter and I can use it in where clause of my SQL - SELECT AccountId, ID, OwnerID, Name, Model__C FROM Opportunity WHERE CreatedDate>='XXXXXXXXXXXX'.
The createDate is stored in 2017-09-12T22:26:37.000Z format. I dont know what is 000Z in this field value.
Thanks
Dipa
Here's an example Apex class that retrieves Opportunities based on a passed-in CreatedDate parameter:
This class accepts a DateTime parameter createDate and uses it in a SOQL query to retrieve Opportunities where the CreatedDate is greater than or equal to the passed-in createDate. Note that we're using the :createDate syntax to bind the parameter value to the SOQL query.
Regarding the 000Z at the end of the CreatedDate field value, it represents the time zone offset from Coordinated Universal Time (UTC). The Z indicates that the time is in UTC. In this case, 000Z indicates that the time zone offset is 0, meaning the time is in UTC with no offset.
Hope this helps !
Thank you.