Get Accounts with at least one closed-won opportunity in Salesforce

Reading Time: < 1 minute

Many companies use Salesforce to manage their business processes. One of the processes that Salesforce can help you with is tracking opportunities. You can use the platform to keep track of which leads or accounts have at least one closed-won opportunity. Knowing which accounts have won an opportunity can help your company target those companies for future sales or marketing efforts.

      
SELECT Id, Name,BillingCity, BillingState, BillingCountry, CreatedDate
FROM Account
WHERE Id IN (SELECT AccountId FROM Opportunity WHERE IsWon = true)
ORDER BY Name
LIMIT 10
      
    

Photo by Gwen Weustink on Unsplash


About the author

Andrés Canavesi
Andrés Canavesi

Software Engineer with 15+ experience in software development, specialized in Salesforce, Java and Node.js.


Join 22 other subscribers

Leave a Reply

Discover more from javaniceday.com

Subscribe now to keep reading and get access to the full archive.

Continue reading