Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Sorting dates in query editor

Hi, 

I am having trouble sorting from newest-oldest for a date column in query editor. I know that I can sort it when I get out of the editor, but I want an applied step that sorts the dates. When I sort by descending, it puts the dates like this: 8/30/2019, 7/30/2020, 6/30/2016, 5/30/2020 (just an example). It sorts the dates based off of the first number rather than the actual date. 

 

Please let me know how I can solve this issue because I need it to be a step in the query because I need to add steps after that rely on the dates being sorted from newest to oldest.

 

 

  • On the home tab in the query editor, there is a Sort button in the center of the ribbon.  Just highlight the column to sort and then choose the sort order.

     

    If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

    Regards,

    Pat

4 Replies

  • mahoneypat's avatar
    mahoneypat
    Microsoft Employee

    On the home tab in the query editor, there is a Sort button in the center of the ribbon.  Just highlight the column to sort and then choose the sort order.

     

    If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

    Regards,

    Pat

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thank you mahoneypat . For some reason, if I use the drop down at the top of the column to sort the dates, it does it incorrectly. However, if I use the sort tab on the home page, it works how it should. Thank you!

  • Vickchan's avatar
    Vickchan
    Regular Visitor

    I did Sort button in the center of the ribbon in query editor, but it was wrong sorting in Data view after refresh. how to fix it?