Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Microsoft Dataverse
Unanswered

View sorted by a date and a date/time field not sorting correctly

(0) ShareShare
ReportReport
Posted on by 123

Dear PowerApps Community,


I've been having an issue with a view that sorts by two fields, the first is a date only field and the second is a date/time field. I appreciate that behind the scenes the date only field will have a time component but in theory this should be the same for all records, right?

I am sorting first by Date Completed (actualdate) and then by Date Created, my expectation would be for 3 or 4 records with the same Date Completed, the sort order should effectively be just Date Created. This is instead what I see:
screenshot1.png

You can see for the 8th March the sort is incorrect on the Date Created (far-right column). 

Microsoft support tell me that this is intended behaviour and on a support environment they showed me this: screenshot2.png

It shows different second components for my 'date only' field. They have told me that the only option is to create a pre-create plugin to set the second component to zero. This seems very odd to me, has anyone else had any experience with this or any similar issues?

 

Thanks in advance,


Matt

 

 



Categories:
  • Drew Poggemann Profile Picture
    9,278 Most Valuable Professional on at
    Re: View sorted by a date and a date/time field not sorting correctly

    Hi @MattTaylor,

     

    Sorry I don't know how to check if the field was changed...

     

    Maybe Microsoft has a way to check this?  Another option would be if you had an initial backup saved somewhere that you could restore to another environment but assume that is not the case...

     

    Thanks,


    Drew  

  • MattTaylor Profile Picture
    123 on at
    Re: View sorted by a date and a date/time field not sorting correctly

    Hi Drew, 

    Thanks for your reply, that's a good point and something I'll have to check - is there any way to tell if the field was changed at some point as it was before my time if it was?

     

    It seemed bonkers to me that this was "by design", so I'm glad someone else agrees! 

  • Drew Poggemann Profile Picture
    9,278 Most Valuable Professional on at
    Re: View sorted by a date and a date/time field not sorting correctly

    Hi @MattTaylor ,

     

    That is not expected behavior in my opinion and I am in a demo tenant to try and recreate the situation and I am unable to do so...

     

    I did the following:

    1. Added a "Date Only" field to the Account called Test Date

    2. Modified the Active Accounts view to sort on this date first and then create date second

    3. Tried multiple updates to the fields on the Test date and the sorting always stayed appropriate for every test.

    4.  Created a Power Automate flow to extract the Test Date and format the output to a variable and the time is always set to 12:00:00 AM which is what I expected.

    dpoggemann_0-1624708917652.png

     

    My question is did you convert this field from a Date / Time to a Date Only field?  I think I have heard of issues when this is done where it maintains the time part on the fields for existing records...

    https://www.inogic.com/blog/2015/07/updating-date-values-of-existing-records-after-modifying-the-datetime-behaviour-in-dynamics-crm-online-update-1/

     

    Hope this helps.  Please accept if answers your question or Like if helps in some way.

     

    Thanks,

     

    Drew

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Leaderboard > Power Apps - Microsoft Dataverse

#1
mmbr1606 Profile Picture

mmbr1606 22 Super User 2025 Season 1

#2
stampcoin Profile Picture

stampcoin 19

#3
Michael E. Gernaey Profile Picture

Michael E. Gernaey 15 Super User 2025 Season 1

Overall leaderboard

Featured topics