0

I'm trying to select the last created closed won opportunity for an account, this is my query used in talend:

SELECT Id, Name, CreatedDate, AccountId, StageName
FROM Opportunity
WHERE StageName = 'Closed Won'
ORDER BY CreatedDate DESC
LIMIT 1

But for the accounts that the last closed won opportunities were created before today the returned value is null, it only gets the opportunities created today.

3
  • @SaiPraveenKakkirala If the account contains as a last one opportunity created for example last month, it doesn't return it, but if the last created opportunity is created today it returns it without problem.
    – Hajar BL
    Mar 7 at 14:12
  • Are you filtering based on AccountId in the above SOQL ? I dont see any issue from SOQL side Mar 7 at 14:21
  • @SaiPraveenKakkirala yes based on AccountId, I do it using talend mapping
    – Hajar BL
    Mar 7 at 14:42

0

You must log in to answer this question.

Browse other questions tagged .