function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
AkiraDioAkiraDio 

Query for custom report

Good day! Please help with the preparation of the query. I have to make a custom report based on a standard.
How do I properly create a query to select all Opp on criteria which are shown below?

 

Best Answer chosen by Admin (Salesforce Developers) 
Hengky IlawanHengky Ilawan

Hi AKiraDio,

 

I assume Order Date is a custom field, so:

 

SELECT ... FROM Opportunity
WHERE StageName <> "Dead/Cancelled'
   AND (
      Order_Date__c = LAST_QUARTER
      OR Order_Date__c = THIS_QUARTER
      OR Order_Date__c = NEXT_N_QUARTERS:4
   )

 -Hengky-

All Answers

Hengky IlawanHengky Ilawan

Hi AKiraDio,

 

I assume Order Date is a custom field, so:

 

SELECT ... FROM Opportunity
WHERE StageName <> "Dead/Cancelled'
   AND (
      Order_Date__c = LAST_QUARTER
      OR Order_Date__c = THIS_QUARTER
      OR Order_Date__c = NEXT_N_QUARTERS:4
   )

 -Hengky-

This was selected as the best answer
AkiraDioAkiraDio

Thank you very much