Deals Closing Soon
Intermediate SolvedEvery Monday, reps get a list of deals expected to close within the next month so nothing slips past its date.
Return the Name of every Opportunity whose CloseDate is within the next 30 days, starting tomorrow. Deals closing today are not included.
Sample data
Opportunity 4 records
| Name | StageName | Amount | CloseDate |
|---|---|---|---|
| Atlas renewal | Prospecting | 40,000 | today + 5 days |
| Beacon pilot | Prospecting | 20,000 | today + 40 days |
| Cobalt rollout | Prospecting | 90,000 | today - 2 days |
| Delta expansion | Prospecting | 55,000 | today + 29 days |
Expected result on the sample
| Name |
|---|
| Atlas renewal |
| Delta expansion |
Row order does not matter. Only the columns above are compared; extra columns in your SELECT are fine.
Hints
NEXT_N_DAYS:30starts tomorrow.
What this tests
NEXT_N_DAYS:30 starts at midnight tomorrow and covers the following 30 days, so today is excluded, while LAST_N_DAYS:n includes today. Knowing exactly where a date literal starts and stops is what keeps a "closing soon" report from losing or double-counting deals on the boundary.
Datasets
Solved on this device only. Sign in with Google to keep your progress across devices.
Run on sample executes your query against the sample data shown on the left and displays the rows it returns. Submit checks it against the sample plus 2 hidden datasets, comparing your rows with the expected rows on each. Queries run in a real Salesforce org; the data is inserted for your run and rolled back afterwards.