Monday, December 17, 2018

List Opportunities where Expected Close Date is either First Day or Last Day of the Month

User wants to filter the result of an opportunity search to only return records where the Expected Close Date is either the First Day or Last Day of the Month. To do this, perform the following steps:

 1. Navigate to Lists > Search > Saved Searches > New.
 
 2. Select Opportunity.
 
 3. In the Criteria tab > Standard subtab, add Formula (Numeric).
 
 4. In the popup window set the following:
  
      Formula
  
      Case When (Decode (to_char({expectedclosedate}, 'DD'), '01', 1, 0)) = 1 Then 1 When (Decode (to_char({expectedclosedate}, 'DD'), to_char(LAST_DAY({expectedclosedate}),'DD'), 1,0)) = 1 Then 1 Else 0 END
  
      Formula (Numeric): equal to
      Value: 1
  
 5. Click Preview or Save & Run.

No comments:

Post a Comment