Answers.Body: <p>A workaround may be adding the 'Birth Date' field three times to the search and use functions for two (i.e one set to 'partial date' - days and the other to month only) and the full date for the third column.</p>
  <p>You don't need to show the first two in your display but can still use them for sorting.</p>
  <p>== Edit - add screenshot ==
  <a href="https://i.sstatic.net/Re2zh.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Re2zh.png" alt="enter image description here" /></a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-12-19T09:51:36.700Z
Answers.Text: Thank you Rebecca, that's exactly what I was trying. But the column for the day is sorted by the original content, not by the content with what I overwrite the original :-/
Answers.UserDisplayName: RomyE
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-12-19T11:44:37.347Z
Answers.Text: @RomyE - Your post describes using smarty rewrites.  The approach Rebecca describes is to use the Field Transformations section - I've added a screenshot.
Answers.UserDisplayName: Aidan
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-12-19T21:28:49.873Z
Answers.Text: My Searchkit/CiviCRM Version was too old (5.53). After updating to 5.55 I found the partial date function and now it works. Thank you both very much!
Answers.UserDisplayName: RomyE
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-12-19T09:17:46.440Z
Answers.LastActivityDate: 2022-12-19T11:45:36.197Z
Answers.LastEditDate: 2022-12-19T11:45:36.197Z
Answers.UserDisplayName: RebeccaTregenna
Body: <p>I've learned here <a href="https://civicrm.stackexchange.com/questions/41907/how-can-i-change-the-date-format-in-a-search-kit-result">How can I change the date format in a Search Kit result?</a>, that I can change the output of a date (in my case birth_date) through rewrite-option and smarty. The reason why is, that I just want to sort the date by day and month to show next birthdays in ascending order.</p>
  <p>So I tried <code>{&quot;[birth_date]&quot;|date_format:&quot;%d.%m.&quot;}</code></p>
  <p>Unfortunately, the column is still sorted including the year of birth, i.e. according to the actual content and not according to the overwriting. Is there an option to manage this?</p>
  
Tags: <searchkit>
Title: Search Kit: How can I sort a rewritten column by the new output (it's sorted by the overwritten content)?
ThreadText: # Search Kit: How can I sort a rewritten column by the new output (it's sorted by the overwritten content)?
  
  (Asked by: username_0 on 2022-12-17)
  
  I've learned here [How can I change the date format in a Search Kit result?](https://civicrm.stackexchange.com/questions/41907/how-can-i-change-the-date-format-in-a-search-kit-result), that I can change the output of a date (in my case birth\_date) through rewrite-option and smarty. The reason why is, that I just want to sort the date by day and month to show next birthdays in ascending order.
  
  So I tried `{"[birth_date]"|date_format:"%d.%m."}`
  
  Unfortunately, the column is still sorted including the year of birth, i.e. according to the actual content and not according to the overwriting. Is there an option to manage this?
  
  **Tags:** searchkit
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2022-12-19. Score: 2 | Accepted answer
  
  A workaround may be adding the 'Birth Date' field three times to the search and use functions for two (i.e one set to 'partial date' - days and the other to month only) and the full date for the third column.
  
  You don't need to show the first two in your display but can still use them for sorting.
  
  == Edit - add screenshot ==
  [![enter image description here](https://i.sstatic.net/Re2zh.png)](https://i.sstatic.net/Re2zh.png)
  
  > **Comments:**
  > **username_0**: Thank you Rebecca, that's exactly what I was trying. But the column for the day is sorted by the original content, not by the content with what I overwrite the original :-/  
  > **username_2**: @username_0 - Your post describes using smarty rewrites.  The approach Rebecca describes is to use the Field Transformations section - I've added a screenshot.  
  > **username_0**: My Searchkit/CiviCRM Version was too old (5.53). After updating to 5.55 I found the partial date function and now it works. Thank you both very much!  
  
  ---
  
  