+ Start a Discussion

SOQL question

Hi all,

I wonder if anyone can help me with this problem.  In the opportunity, there is a field called "close date", so whenever I use excel connector to retrieve opportunities, I would like to write a SOQL statement to only retrieve the opportunity with the most recent close date. 

Please let me know what you think.  I am currently using excel connector's callable function, soql_table.. here is my statement

soql_table("Opportunity", "Workspace_ID__c = " & "'" & sourceWSID & "'")

This statement sometimes returns mutiple opportunities, so if i can add in the SOQL statement on close date, then it will be perfect and return only the "most recent close date opportunity"

Your help is much appreciated.