function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
moverdorfmoverdorf 

Order By help... Should be an easy one (Ihope)

I have the following query, but I need to order the results by ActivityDate in descending order.

 

SELECT (SELECT
         ActivityDate,
         Description,
         Subject,
         IsClosed,
         CallType,
         CallDisposition,
         Status,
         ActivityType
        FROM OpenActivities
        )
FROM Account

 

if I put order by ActivityDate desc like so:

 

SELECT (SELECT
         ActivityDate,
         Description,
         Subject,
         IsClosed,
         CallType,
         CallDisposition,
         Status,
         ActivityType
        FROM OpenActivities

        order by AcivityDate desc
        )
FROM Account

 

It comes out the same order as if I don't have any order by. Can anyone tell me how to get the order in the way I need it?

 

Thanks so much.

 

 

firechimpfirechimp
Hi moverdorf,
The order by key word is used correctly in this example, how are you processing these records for display after the query? Because that may be where the issue occurs.