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
Hania D'AvoineHania D'Avoine 

Hi, I am trying to sort start_date_c field by year in a sdoc template, however not having much luck. Hoping you could help me out

Tejpal KumawatTejpal Kumawat
Hello Hania,

Create Formula field on your object like : YEAR( start_date_c) and query
SELECT CloseDate,tkcommunity__Year__c
FROM Opportunity
ORDER BY tkcommunity__Year__c DESC
Formula field :
User-added image

If this answers your question mark Best Answer it as solution and then hit Like!