You need to sign in to do that
Don't have an account?
Tai Rahman 10
Help with SOQL Query in Workbench
Hello,
We have a custom object (Activation_Step__c ) that tracks the necessary steps (ex: Inventory_Status__c) required to complete an Opportunity.
I am trying to find the completion dates for each of the required steps but so far coming empty handed as I'm getting the overall LastModifedDate for the Object as opposed to the individual steps themselves:
select Opportunity__c, id, CreatedDate, Inventory_Status__c, Contact_Status__c, Payment_Status__c, Contract_Status__c, Activation_DateTime__c, LastModifiedDate
from Activation_Step__c
I am new to SOQL, but have decent experience with MSSQL, and theoretically given the fields above, it would have been easy select top 1 subselects.
Any advice on how to achieve this using SOQL via Workbench?
Thank you in advance!
We have a custom object (Activation_Step__c ) that tracks the necessary steps (ex: Inventory_Status__c) required to complete an Opportunity.
I am trying to find the completion dates for each of the required steps but so far coming empty handed as I'm getting the overall LastModifedDate for the Object as opposed to the individual steps themselves:
select Opportunity__c, id, CreatedDate, Inventory_Status__c, Contact_Status__c, Payment_Status__c, Contract_Status__c, Activation_DateTime__c, LastModifiedDate
from Activation_Step__c
I am new to SOQL, but have decent experience with MSSQL, and theoretically given the fields above, it would have been easy select top 1 subselects.
Any advice on how to achieve this using SOQL via Workbench?
Thank you in advance!
In case if there are separate date fields to each step then you can simply mention them as the fields to be fetched and you would be getting the field values.
If that is not the scenario can you mention how are you storing the dates so that we can check further and respond back.
Looking forward to your response.
Thanks.
Thanks for getting back to me! So basically what I'm trying to do is get the earliest CreatedDate for each of the status fields from the Activation_Step__History.
For example, If I ran the query above, it would return about 150-200 rows for each unique Opportunity. What I need is the earliest creation date for say Inventory_Status__c; in MSSQL I could write:
(select top 1 CreatedDate
from Activation_Step__History
Activation_Step__c.ParentId = Activation_Step__History.ParentId
where Field = Inventory_Status__c
and NewValue = 'Step Complete!'
Order by CreatedDate asc)
So was just hoping I could get some help on how to achieve the same thing using SOQL.
Thanks!
To execute SOQL or SOSL queries, go to queries tab & click on query type you want to execute and select the object, fields you want to query and also you can filter results by using filter result by section. Query will automatically come based on your selection