Deals Closing Soon

Intermediate

Every 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

NameStageNameAmountCloseDate
Atlas renewalProspecting40,000today + 5 days
Beacon pilotProspecting20,000today + 40 days
Cobalt rolloutProspecting90,000today - 2 days
Delta expansionProspecting55,000today + 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:30 starts 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.

SOQL

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.